<el-form-item label="开户支行:" prop="branchName">
<el-autocomplete
v-model="form.branchName"
popper-class="my-autocomplete"
:fetch-suggestions="queryBranchSearch"
value-key="branchName"
placeholder="请输入内容"
style="width: 100%;"
clearable
:disabled="reviewFlag"
@select="handleBranchSelect"
>
<template slot-scope="{ item }">
<div class="name" :title="item.branchName">{
{
item.branchName }}</div>
</template>
</el-autocomplete>
</el-form-item>
queryBranchSearch(queryString, cb) {
var results = queryString ? this.bankBranchList.filter((provinceCity) => provinceCity.branchName.toLowerCase().match(queryString.toLowerCase()) !== null) : this.bankBranchList;
// 调用 callback 返回建议列表的数据
clearTimeout(this.timeout);
this.timeout = setTimeout(() => {
cb(results);
}, 600);
},
handleBranchSelect(item) {
this.form.branchNo = item.branchId || '';
},
Vue前端实现输入框过滤可选项的过滤效果
猜你喜欢
转载自blog.csdn.net/wangleisuiqiansuiyue/article/details/109191701
今日推荐
周排行