[Vuejs]-How to enrich event data in Vue.js

2👍

You have several options to achieve that:

  1. You can pass as a props index to child component and then in child emit function send object containing updated index with updated value.
  2. You can change your current code to something like this: @updateItem="updateItem(index, $event)" where $event is updated value
👤kadash

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)).

👤Psidom

Leave a comment