sharestone

<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;
}
})

分类:

技术点:

相关文章:

  • 2021-09-10
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
  • 2022-01-03
  • 2022-01-06
猜你喜欢
  • 2021-09-10
  • 2022-12-23
  • 2021-11-11
  • 2022-03-02
  • 2021-05-12
  • 2021-09-10
相关资源
相似解决方案