el-select remote remote share a search for more options, options change when the value of the input box does not display the name issue

 Reason: el-select remote share a plurality of remote search options, when the request data using the remote-method, options are changed, the value of value is not included in the options, the value is a value id, display id of course, do also shows that name?

Try to solve, we found that the options blank, can retain the value of name

Program are as follows:

@focus="handleFocus"

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

 

------------------------ Other programs try to be ---------------------

First, the use of different options

1.remote-method passes the index parameter

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

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

2. The same can also be used :valueand @inputadded to indexdefine its own logic

Two, or you can use the input of the remote search

Guess you like

Origin www.cnblogs.com/heroljy/p/11424720.html