[Vuejs]-Check all checkbox on one checkbox in Vue

0👍

You could add a watch hook:

watch: {
    allSelected: {
        immediate: true,
        handler: function(val) {
            if (val) {
                this.selectAll = true;
                this.returnData();
            } else {
                this.selectAll = false;
            }
        }
    }
}

And then make all the checkboxes dependent on selectAll

Leave a comment