(vue.js)vue中怎么设置select默认选中
<div>
<select v-model="selected">
<option v-for="opt in options" v-bind:value="opt.value">{{opt.text}}</option>
</select>
<br>
<span>Selected: {{ selected }}</span>
</div>
var options = [
{ text: \'A-label\', value: \'A\' },
{ text: \'B-label\', value: \'B\' },
{ text: \'C-label\', value: \'C\' }
];
new Vue({
el: \'#app\',
data: {
selected: \'A\',
options: []
},
created: function(){
this.options = options;
}
})
以上是 (vue.js)vue中怎么设置select默认选中 的全部内容, 来源链接: utcz.com/z/378011.html