JS
querySearch(queryString,cb) {
if(queryString){
Api.JHAjAx({
reelCode:queryString,
status:1
}).then(res=>{
console.log(res.data)
if(res.data.code == 0){
let arr = res.data.dataList.rows;
cb(arr)
}
})
}else{
cb([]);
}
},
handleSelect(item){
console.log(item)
if(item){
this.state2 = item.reelCode;
// this.bianjiDialogHeJinZhuangTai = item.
this.bianjiDialogTouRuLiang = item.weight;
this.bianjiDialogPeiLiaoGuiGe = item.spec;
}
},
html
<el-autocomplete
class="inline-input"
v-model="state2"
:fetch-suggestions="querySearch"
placeholder="请输入内容"
@select="handleSelect"
>
<template slot-scope=" {item} ">
<span>{{item.reelCode}}</span>
</template>
</el-autocomplete>