When I check one checkbox I want to disable two other checkboxes.
But when I uncheck this first checkbox two other should be enabled again. I don`t know how to do that.
For now when I uncheck the first checkbox the other two remain disabled, I want it enabled.
Here is my code:
<div id="app"><template>
<input type="checkbox" name = "qwe" @change="changeStatus(c)" :disabled="selectedContent.length > 0 && selectedContent[0] != c">
<input type="checkbox" name = "asd" @change="changeStatus(b)" :disabled="selectedContent.length > 0 && selectedContent[0] != b">
<input type="checkbox" name = "zxc" @change="changeStatus(d)" :disabled="selectedContent.length > 0 && selectedContent[0] != d">
</template>
</div>
new Vue({
el: "#app",
data: {
selectedContent: [],
c: '1',
b: '2',
d: '3',
},
methods: {
changeStatus: function(data) {
if (this.selectedContent.length === 0) {
this.selectedContent.push(data);
}
}
}
})
Please help me.