1,html代码
<el-autocomplete
            v-model="query.providername"
            :fetch-suggestions="providernameSearch"
            placeholder="请输入内容"
            @select="handleProvidername"
            :trigger-on-focus="false"
          ></el-autocomplete>
 
2,js
providernameSearch(queryString,callback){
      var list = [{}]
      if(queryString && queryString.length>0){
        let parms = {
          name:queryString
        }
        providerformFindProvider(parms).then(res=>{
          if(res.status == "ok"){
   //处理成自己想要的格式
            list = res.data.map(item=>{
              return {
                id:`${item.id}`,
                value:`${item.name}`
              }
            })
            callback(list);
          }
        })
      }
    },
    handleProvidername(item){
      this.query.providername = item.value;
      this.providername = item.value;
    },