I'd like to make two checkboxes which get value from store.js and send them to backend through a form:
<label>Notify me
<input type="checkbox" v-model="notification" value="notification" />
</label>
<label>Email me
<input type="checkbox" v-model="email" value="email" />
</label>
I get the values as a computed property:
computed: {
BASE_URL () {
return this.$store.state.BASE_URL;
},
notification () {
return this.$store.state.notification;
},
email () {
return this.$store.state.email;
}
}
The problem is that checking the checkboxes does not change the values in the store, and in addition to that I get this warning in the console, like:
vue.esm.js?65d7:479 [Vue warn]: Computed property "notification" was assigned to but it has no setter.
I know that one can define setter in computed property, as described in the vue.js docs, but I don't know how to do that when there are multiple values to set, like in my particular case.
So appreciate your help to fix this.