[Vuejs]-In Vuetify, how to prevent a checked v-checkbox from being deselected?

0👍

Here is the working codepen
https://codepen.io/manojkmishra/pen/dyYERzX

Template part:

<div id="app">
 <v-app id="inspire">
   <v-container fluid>
     <v-layout row wrap>
       <v-flex xs12 md6>
         <v-subheader>Checkbox</v-subheader>
          <v-card flat>
           <v-card-text>
             <v-checkbox :disabled="disabled" v-bind:label="`Checkbox 1:    ${ex1.toString()}`" v-model="ex1" light @ @change="hehe"></v-checkbox>             
              </v-card-text>
          </v-card>
        </v-flex>
      </v-layout>
    </v-container>
  </v-app>
</div>

Script part:

new Vue({
el: '#app',
data () {
return {
  ex1: false,
  disabled:false,
}
  },
 methods:{
hehe(){
  console.log("hehe")
this.disabled=true;
    }
  }
})

Leave a comment