0👍
https://v2.vuejs.org/v2/guide/reactivity.html#For-Arrays
Vue 2’s reactivity system can’t detect when you change an array’s element using index.
The equivalent of
<input v-model="yourProperty/>
is
<input :value="yourProperty" @input="newValue => {value = newValue}
<!-- or alternatively: -->
<input :value="yourProperty" @input="value = $event"/>
So you need to write your own input handler that use Vue.set rather than the JavaScript = operator
So try
<template>
<v-chip-group
:value="meh[index]"
@input="newChipGroupValue => handleInput(newChipGroupValue, indexToUpdate)"
>
...
</template>
<script>
...
methods: {
handleInput(newChipGroupValue, indexToUpdate) {
//remember to import Vue from vue
Vue.set(this.meh, indexToUpdate, newChipGroupValue);
}
}
</script>
-1👍
Sir, maybe you can put the event under v-chip-group.
<v-chip-group
v-model="meh[index]"
multiple
@event here
- [Vuejs]-JQuery Ajax callback to a class method seemingly calling wrong instance
- [Vuejs]-Is it possible to refer to a global bus in the template of a component?
Source:stackexchange.com