Skip to content

Instantly share code, notes, and snippets.

@PKTseng
Created August 10, 2020 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PKTseng/7344f45b483f0644b8c55ec893d4fa93 to your computer and use it in GitHub Desktop.
Save PKTseng/7344f45b483f0644b8c55ec893d4fa93 to your computer and use it in GitHub Desktop.
checkbox-agree
<div id="app">
<input type="checkbox" id="check" v-model="agree">
<label for="check">agree</label>
<h1>{{agree}}</h1>
<button @click="submit">submit</button>
</div>
new Vue({
el:'#app',
data:{
agree: false,
},
methods:{
submit(e){
if(this.agree !== true){
alert(" agree!!!!!!!!!");
return;
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment