本来是想在点击选项时获取选项的值,给option加的click事件,但是并没有生效

后面查了一下是因为:select 中的option 识别不了onclick,,需要在select上做onchange进行识别。。

 

<select  @change="selectNode(selected)" v-model="selected">
    <option  v-for="(item,index) in userList" :value="item.name" :key="index">{{item.name}}</option>
</select>

selectNode(node){
  this.selected = node;
},

 

相关文章:

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