Answer the question
In order to leave comments, you need to log in
How to call child component method?
You need to call a method from a child component if the child component is the same component as the parent.
For example:
<some-component>
<another-component>
<some-component></some-component>
</another-component>
<another-component>
<some-component>
<some-component />
</some-component>
</another-component>
<some-component></some-component>
</some-component>
Answer the question
In order to leave comments, you need to log in
There was such a question at the interview)
I solved it through ref. (here there is an implementation https://github.com/AlexeyCaTHaR/testAssignment )
It was proposed to forward the method and everything that is needed for this through provide / inject.
There is an option to enumerate vm.$children and, depending on the name of the component, register it in the "pool" of child components and force the method to run
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question