Answer the question
In order to leave comments, you need to log in
How to call a method from another component in vue.js?
There are two components, in the first component I want to call a method from the second one, how to do it?
Answer the question
In order to leave comments, you need to log in
Or cut global functions like services or cut vuex and share state between components.
Since you don't need to write, it goes against all patterns in general.
In the template, assign a ref to the component whose method you want to call, further in the code:
If the task is simply to call some common functions, then there are plugins, mixins, directives for this - use what is better / more convenient in a particular case.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question