0👍
I don’t think this is much better than using v-on:change
, but you can use watch
like this:
watch: {
masterCheckbox: function(val, oldVal) {
if (!val) {
this.otherCheckbox= val;
this.andOtherCheckBox = val;
}
}
}
A little bit shorter though since you don’t need to put v-on:change
on the master checkbox and your methods
is a bit cleaner (maybe)
Demo here: https://codesandbox.io/s/nameless-cherry-mnvps?file=/src/App.vue
- [Vuejs]-Vuetify date picker doesn't save the correct date if i type it in my text field
- [Vuejs]-Dynamic background image based on javascript variable
Source:stackexchange.com