Created
August 11, 2020 02:06
-
-
Save PKTseng/737bc2148de63148fff6520974608b35 to your computer and use it in GitHub Desktop.
checkbox-1
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="chk" v-model="agree"> | |
<label for="chk">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(){ | |
if( this.agree !== true){ | |
alert('agreeeeeeee'); | |
return | |
} | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment