I have a parent component which has child A and child B, child B has Child C inside it.
So I need to trigger an event from child A to Child C, what is the best way to to this?
Or maybe is there a way to watch for a change in the store.state?
I have a parent component which has child A and child B, child B has Child C inside it.
So I need to trigger an event from child A to Child C, what is the best way to to this?
Or maybe is there a way to watch for a change in the store.state?
Since you're using a store, I assume Vuex, just watch the store state change. To do that, you need to bring that piece of the store into your component with a computed property. Then watch the computed property.
{
computed:{
myProp(){
return this.$store.state.myProp
}
},
watch:{
myProp(){
//myProp changed
}
}
}