How to determine whether a checkbox is checked or not in Vue js
You can do something like:
if(this.rolesSelected != "") {
alert('isSelected');
}
or
v-on:click="samplefunction({{$role->id}},$event)"
samplefunction : function(value,event) {
if (event.target.checked) {
alert('isSelected');
}
}
This worked for me.
<input type="checkbox" :id="poid" class="unchecked" name="single_select" ref="rolesSelected">
function (){
if(this.$refs.rolesSelected.checked == false) {
//do something
}
}
function (){
if(this.$refs.rolesSelected.checked == true) {
//do something
}
}