2👍
✅
You have several options to achieve that:
- You can pass as a props index to child component and then in child emit function send object containing updated index with updated value.
- You can change your current code to something like this:
@updateItem="updateItem(index, $event)"
where $event is updated value
1👍
Updating your event listener as @updateItem="data => updateItem(index, data)"
should work. Assuming you have emitted data from child component (i.e. something like this.$emit('updateItem', somedata)
).
Source:stackexchange.com