[Vuejs]-Index of v-for as value for v-model

0👍

Use :value=ob.numero.$model and not a v-model

and then add an @change handler:

@change="updateNumero(index, $model)"

and then create that function:

methods: {
  updateNumero(index, model) {
    $v.especifications.$each.$iter[index].numero[model] = parseInt(index) +1
  }
}

I won’t guarantee that this is reactive, but it’ll work.

Leave a comment