I am working with a group of checkboxes, each with its own model. These checkboxes need to be enabled or disabled based on the state of a master checkbox. Enabling and disabling them is simple, as I just need to include :disabled="!MasterCheckbox"
in each checkbox.
However, if I fill out some of these checkboxes and then decide to disable them, I want their values to revert back to false. My current solution involves using a v-on:change
event on the master checkbox, where I manually set the values of each checkbox model to false by looping through a dictionary. While this method works, I'm curious if there is a more elegant or efficient way to achieve the same outcome. Perhaps there's a directive or prop that I could utilize instead. Any suggestions would be greatly appreciated.