Created
August 10, 2020 15:02
-
-
Save PKTseng/7344f45b483f0644b8c55ec893d4fa93 to your computer and use it in GitHub Desktop.
checkbox-agree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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