原因:el-select remote 远程搜索 多个共享一个options,当使用 remote-method 请求数据后,options被改变,value的值不包含在options中,value的值是一个id,当然就显示id了,难道还显示name?

尝试解决的时候发现,把 options 置空,可以保留name的值

方案如下:

@focus="handleFocus"

handleFocus() {
  this.options = [];
}

 

------------------------ 其它方案有待尝试 ---------------------

一、使用不同的options

1.remote-method传递索引参数

v-bind="{ remoteMethod: remoteQuery.bind(null,i) }"

methods: {
  remoteQuery(i, query){
    console.log(i)
  }
}

2.同样也可以用:value@inputindex定义自己的逻辑

二、或者也可以使用input的远程搜索

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2021-10-15
  • 2021-07-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-01-18
相关资源
相似解决方案