Answer the question
In order to leave comments, you need to log in
How to pass $refs to another Vue component?
Good afternoon!
There is a parent component, it has a $refs.element element
How to pass this reference to the element to the child component?
Well, or how to get access from the child component to this element in the parent component?
UDP: $parent is only suitable for the immediate parent, needs access to any ancestor in the hierarchy.
Answer the question
In order to leave comments, you need to log in
The child component has a $parent property - this is the parent component.
Accordingly, in the child component:this.$parent.$refs
Why not just pass this $refs.element to the props of the child component.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question