Vue中的radio的使用方法
<html><head><script src='js/vue.js'></script></head><body><div id="example"><input ty
·
<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>
<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>
更多推荐
已为社区贡献7条内容
所有评论(0)