[Vuejs]-VueJs, send to method if checkbox is checked

4👍

Just pass $event object as the second argument.

Reference.

<tr v-for="item in dataset" :key="item[0]" >                     
  <td>
    <input :checked="item[2]" type="checkbox" @change="updateService(item[0], $event)" />
  </td>
</tr>

export default {
  methods: {
    updateService(firstArgument, event) {
      console.log(event.target.checked);
    }
  }
}

Leave a comment