通过v-model实现数据双向绑定
<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h1>zhaoyuang</h1>
<!--view层,模板-->
<div id="app">
<!--输入的文本:<input type="text" v-model="message"> {{message}}-->
<!--<textarea name="" id="" cols="30" rows="10" v-model="message"></textarea>
{{message}}-->
<!-- 性别:
<input type="radio" name="sex" value="男" v-model="zyh">
<input type="radio" name="sex" value="女" v-model="zyh">
<p>
选中了谁:{{zyh}}
</p>-->
<select name="" id="" v-model="zyh">
<option value="" disabled>--请选择--</option>
<option>A</option>
<option>B</option>
<option>C</option>
</select>
<span>value:{{zyh}}</span>
</div>
<!--1.导入Vue.js-->
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>
<script>
var vm = new Vue({
el: "#app",
//Model:数据
data: {
zyh : ''
},
});
</script>
</body>
</html>