Currently, I am iterating through the root component, which contains a child component within it.
<root-select v-for="offer in offers" >
<child-options v-for="item in options" >
</child-options>
</root-select>
However, when I use $emit
to trigger a function in the root component from the child component, all instances of the root component are affected by the data change.
Child Component:
EventBus.$emit('toggle', value);
Root Component:
EventBus.$on('toggle', this.toggle);
I actually need the data changes to only occur within the specific component that triggered the event. Any suggestions would be greatly appreciated.
Thank you.