When using Vuex with Vue components, handling static fields that are editable is easily done through computed properties:
computed: {
text: {
get() {
return ...
},
set(value) {
this.$store.commit...
},
},
},
<input type="text" v-model="text">
But what about when rendering a list of options that need to be bound?
options = [
{
value: ...,
text: ...,
},
{
value: ...,
text: ...,
},
...
];
<input type="text" v-model="option.text" v-for="option in options">