vue select 获取选择的value 进行更新

<select v-model="data.content.channelTag">

  <option value="0" disabled>请选择</option>
   <template v-for="item in channelTag">     
    <option v-if="item.dictname==data.content.channelTagShow" selected v-bind:value="data.content.channelTag">
      {{data.content.channelTagShow}}</option>     <option v-else v-bind:value="item.dictid">{{item.dictname}}</option>   </template> </select>

option绑定value,获取选定的option.value,然后更新option.text !

可以添加默认的option,然后把value 设置为不可选,然后data 里指定 data.content.channelTag = 0;


posted @ 2017-05-05 15:04  青鸟and飞鱼  阅读(1768)  评论(0编辑  收藏  举报