Skip to content
Advertisement

How to determine whether a checkbox is checked or not in Vue js

I just want to determine whether a checkbox is checked or not in Vue js 2. In jquery we have functions like $(‘input[type=checkbox]’).prop(‘checked’); which will return true if checkbox is checked or not. What is the equivalent function in Vue js.

Here is the scenario with code. Please note i am using laravel with its blade templates.

JavaScript

The js part is

JavaScript

Advertisement

Answer

You can do something like:

JavaScript

or v-on:click="samplefunction({{$role->id}},$event)"

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement