Subscribe on changes!

setting ref on slot using a v-for does not work

avatar
Oct 9th 2020

Version

3.0.0

Steps to reproduce

Have something similar to this:


<slot v-for="item of [1,2,3]" :ref="setRef1" :key="index"/>
<div v-for="item of [1,2,3]" :ref="setRef2" :key="index"/>

function setRef1(element) {
 console.log(element) /// always undefined
}

function setRef2(element) {
 console.log(element) /// works as expected
}

What is expected?

Refs should be set

What is actually happening?

The first param passed to the setRef function is always undefined

avatar
Oct 9th 2020

Don't open issues without boiled down reproductions. Open a new issue once you have a boiled down reproduction on a jsfiddle