I have a ref that should be passed to props, but when I do so ref is undefined in child component
parent.vue
<div ref="target">target</div> <cmp :target="$refs.target" />
cmp.vue
mounted() { console.log("target:", this.target); // undefined },
Example: codesanbox
after hot module replacement target is correct
New contributor
Egor Antropov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.