Last active
August 29, 2015 13:56
-
-
Save anakahala/9248889 to your computer and use it in GitHub Desktop.
Vue.jsでボタン活性非活性
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
<!doctype html> | |
<html> | |
<head> | |
<title>Button Disabled By Vue.js</title> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<h2>Button Disabled By Vue.js</h2> | |
<div id="app"> | |
<div> | |
<input v-model="agree" type="checkbox" />利用規約に同意します | |
<button v-attr="disabled: !agree">Submit</button> | |
</div> | |
<div> | |
<input v-model="textValue" /> | |
<button v-attr="disabled: textValue == ''">Submit</button> | |
</div> | |
</div> | |
<script src="js/vue.min.js"></script> | |
<script type="text/javascript"> | |
var app = new Vue({ | |
el: '#app', | |
data: { | |
agree: false, | |
textValue: '' | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment