I am using the bootstrap-vue package and have a checkbox as follows:
<b-form-checkbox v-model="isSelected"switch></b-form-checkbox>
i have data property
data(){
isSelected: false
}
what i would like to do is for user to click the checkbox and before the checked value is changed is to perform some sort of validation by calling a method. The method may then prevent the value being changed.
How can i do this?
I have tried to bind method to the @change event but then when i try to set this.isSelected = false
the checkbox value is still checked.
I finally achieved it using @click.native.prevent
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With