element 搜索加载,模糊查询
<el-autocomplete
v-model="dform.auto_idname"
@select="openxuanfun"
:debounce="1000"
:fetch-suggestions="querySearch"
placeholder="车辆"
value-key="auto_number"
></el-autocomplete>
// 搜索匹配
querySearch(queryString, cb) {
this.getcarpaifun(queryString, cb)
// 调用 callback 返回建议列表的数据
},
// 点击选项后
openxuanfun(e) {
this.dform.auto_id = e.id
},
// 请求搜索
async getcarpaifun(key, cd) {
const { data: res } = await GetautoList({ key, list_type: 'all' })
cd(res.data.list)
},