element 搜索选择

html

<el-select
v-model="dform.e_id"
filterable
remote
reserve-keyword
placeholder="请输入关键词"
:remote-method="remoteMethod"
:loading="loading">
<el-option
v-for="item in optionsdata"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>

js

// 搜索选择
remoteMethod(query) {
if (query !== '') {
this.loading = true
this.getequipmentistfun(query) //方法
} else {
this.options = []
}
},
数据处理

// 父级选中的值
handfuleChange(e) {
console.log(e)
this.dform.p_id = e[e.length-1]
},
原文地址:https://www.cnblogs.com/lixiaosong/p/15480699.html