Answer the question
In order to leave comments, you need to log in
How to add the item all to the filter?
How to write a filter? here they helped me with the filter, but how to correctly add "all" to the array of filters, so that when you click on everything, the rest of the filters are reset and vice versa, when you click on any other, the all button goes out
Answer the question
In order to leave comments, you need to log in
You can make a computed property with a setter:
computed: {
all: {
get() {
return this.filters.every(n => n.active);
},
set(val) {
this.filters.forEach(n => n.active = val);
},
},
},
<label>
<input type="checkbox" v-model="all">
ALL
</label>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question