[Vuejs]-How to return value into the script of another Vue file? Or how to sent returned value into another Vue file?

0👍

You can use global variable even tough this is not the main purpose of it in your case.

You define it somewhere with Vue.prototype.$myvar

And you can use it in your component like this.$myvar

However you should probably have a look at Vuex and the concept of store.

0👍

You could pass them from parent to child using props.

If you have to navigate you could use vue-router and pass them as parts of the route and then retrieve them in the second page

If you want an even more decoupled way of communicating you could use EventBus or go all the way an use Vuex.

Most likely you just need to pass them as props, so declare a child that has the props declared

export default {
 props:['breedKey', 'time']
}

and then pass them

<ChildComp :breedKey="breedKey" />

Leave a comment