1、html

<div id="app-8">
  <select v-model="selected">
    <option v-for="option in options" v-bind:value="option.value">
      {{ option.text }}
    </option>
  </select>
  <span>Selected: {{ selected }}</span>
</div>

 

2、script

var app8 = new Vue({
  el: '#app-8',
  data: {
    selected: 'A',
    options: [
      { text: 'One', value: 'A' },
      { text: 'Two', value: 'B' },
      { text: 'Three', value: 'C' }
    ]
  }
})

 

相关文章:

  • 2022-12-23
  • 2022-01-02
  • 2021-09-21
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
  • 2021-12-30
  • 2021-07-28
猜你喜欢
  • 2021-11-29
  • 2021-09-02
  • 2021-10-10
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案