I currently have a list of customers stored as an array of objects in Vuex. When rendering this list in my component, each row includes a checkbox using Keen-UI:
<tr v-for="customer in customers" :class="{ selected: customer.selected }">
<td>
<ui-checkbox :value.sync="customer.selected"></ui-checkbox>
</td>
<td>{{ customer.name }}</td>
<td>{{ customer.email }}</td>
</tr>
However, the checkbox directly modifies the customers array, which is causing issues because I am using strict mode in Vuex and it throws an error.
I need to track changes made to the array and then call an action to update the Vuex state accordingly:
watch: {
'customers': {
handler() {
// ...
},
deep: true
}
Even with this setup, the customer object is still being changed directly. How can I go about resolving this issue?