v-model指令来实现表单元素和数组的绑定
v-model结合input
<div id="app">
<input v-model="message" >
<h2>{
{
message}} </h2>
</div>
<script>
var app = new Vue({
el:'#app',
data: {
message:'麻烦给我的爱人来一杯Mojito '
}
})
</script>
v-model结合radio
<div id="app">
<label for=male""><input type="radio" value ='男' v-model="gender" id="male">男</label>
<label for="female"><input type="radio" value ='女' v-model="gender" id="female">女</label>
<h2>您选择的性别是: {
{
gender}} </h2>
</div>
<script>
var app =