Vue中的radio的使用方法

<html>
<head>
<script src='js/vue.js'></script>
</head>
<body>
<div id="example">
<input type='radio' id='wuhan' value='武汉' v-model='city'/>
<label for='wuhan'>武汉</label>

<input type='radio' id='xian' value='西安' v-model='city'/>
<label for='xian'>西安</label>

<input type='radio' id='hangzhou' value='杭州' v-model='city'/>
<label for='hangzhou'>杭州</label><br>

<span>欲望都市:{{ city }}</span>
</div>
</body>


<script type='text/javascript'>
new Vue({
el: '#example',
data: {
flag: true,
city: ''
},
methods: {

},
computed: {

},
created() {

}
});
</script>
</html>

猜你喜欢

转载自blog.csdn.net/qq_23143555/article/details/80724596
今日推荐