vue中select实现单选

<html>
<head>
<script src='js/vue.js'></script>
</head>
<body>
<div id="example">
<select v-model='city'>
<option value='西安'>西安</option>
<option value='洛阳'>洛阳</option>
<option value='南京'>南京</option>
<option value='北京'>北京</option>
</select>
<span>欲望都市:{{city}}</span>
</div>
</body>


<script type='text/javascript'>
new Vue({
el: '#example',
data: {
city: ''
}
});
</script>
</html>

猜你喜欢

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