let's say I got the following structure:
// parent template
<div v-for="item in items">
<span>Parent</span>
<children1>
// inside children1, i got another children
<children2 @on:finished="onFinished"></children2>
<button>Click me</button>
</children1>
</div>
Then in the children1 methods
i would have something like this to listen children2:
methods: {
onFinished: function () {
// Here i would like to disable `click me` button and change its text for this particular item inside the iteration
}
}
From children2 I just execute this when something finishes in there.
this.$emit('on:finished', true)
As I write in the inside of the method, I would like to be able to change with VueJS only one of the items by the $emit from its children. But I was thinking using a data property, but that would affect the entire template, what about using computed maybe? will that work? but how?
Any suggestions?