Answer the question
In order to leave comments, you need to log in
vue router. How to communicate with a component in a route without using Vuex?
The option to get a parameter from the route and request data from the REST API on it seems, if not a crutch, then not always optimal.
How can you receive and pass component data for a route using props and $emit?
Answer the question
In order to leave comments, you need to log in
In any component, the root Vue is available via this.$root
, although the documentation insists that it's better to switch to vuex instead .
You can store data in this.$root.$data
as an option. Write them there directly, or, more gently, call events on the root from the component:
this.$root.$emit('formFilled', {name:"Ivan", job:"developer"})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question