[Vuejs]-How to change props in child component created using v-for in VueJs 3

1๐Ÿ‘

โœ…

As per my understanding, You want to update the actor for the specific child in the parent component based on the act_id passed from child. If Yes, You can achieve this by iterating the original array object in the parent.

In the parent component, Your changeActor method should be like this :

In template :

@fix="changeActor($event)"

In script :

changeActor(emittedObj) {
    store.plan.forEach(item => {
        if (item.act_id === emittedObj.act_id) {
            item.actor = emittedObj.actor
        }
    });
}
๐Ÿ‘คDebug Diva

Leave a comment