I have a computed setter:
rating: {
get() {
return this.$store.state.rating;
},
set(value) {
console.log(value);
this.$store.commit('updateFilter', {
name: this.name,
value
});
}
}
This is linked to my rating like so:
<label>
<input type="checkbox" :value="Number(value)" v-model="rating">
{{ index }}
</label>
I expect the computed setter to log an array because when I use a watcher to watch for changes on the rating model I am getting an array.
Except whenever I use a computed setter like above it simply outputs true
when a checkbox is selected or false
when they are all deselected.
What is going on here, should I just be getting an array just as like with a watcher?