I am trying to implement a toggle feature where a user can enable a day and then select AM or PM with checkboxes.
The problem I am having is trying to de-toggle the button if the user unchecks AM and PM.
Screenshot:
Markup
<div class="form-group-checkboxes col-xs-1 pt14">
<toggle v-model="availability.monday.active" theme="custom" color="blue"></toggle>
</div>
<div class="form-group-checkboxes col-xs-2">
<h4>Mon</h4>
</div>
<div class="form-group-checkboxes col-xs-1 mt10">
<label class="checkbox-inline"><input type="checkbox" name="mondayAM"
class="pull-left"
:disabled="availability.monday.active ===false"
v-model="availability.monday.am">AM</label>
</div>
<div class="form-group-checkboxes col-xs-1 ml20 mt10">
<label class="checkbox-inline"><input type="checkbox" name="mondayPM"
class="pull-left"
:disabled="availability.monday.active ===false"
v-model="availability.monday.pm">PM</label>
Data:
monday: {
active: true,
am: true,
pm: true,
},
tuesday: {
active: true,
am: true,
pm: true,
},
wednesday: {
active: true,
am: true,
pm: true,
},
I tried creating a computed property that checks the AM and PM property values.
toggleMonday() {
return this.availability.monday.am === true && this.availability.monday.pm === true;
},
However that did not provide the toggle experience required.
TLDR, how can I allow different elements with their own binded values to affect each other
e.g.
- User toggles Monday off, AM and PM become unchecked
- User toggles Tuesday on, unchecks AM and PM, then Tuesday becomes untoggled.

||, not&&.