Vue select 下拉菜单

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' }
    ]
  }
})

 

posted @ 2018-09-11 23:42  Pythia丶陌乐  阅读(592)  评论(0编辑  收藏  举报