[Vuejs]-How can I access data from a parent route into the childs route?

0👍

Vuex is your answer.
You need to store data in store to really properly share data between components.

Just follow Vuex docs: https://vuex.vuejs.org/en/intro.html

Initialize your store, create necessary actions/mutations
and to get data in your child component you will just need to use:

computed() {
someData: {
return this.$store.states.someDataFromParaent
}
}

Leave a comment