<a-select v-model="queryParam.sourceId" placeholder="请选择" :filterOption="optionInput" showSearch>
<a-select-option v-for="(item,index) in sourceOptions" :key="index" :value="item.id">{{ item.source_name }}</a-select-option>
</a-select>
mixins: [optionInputSearch],
// 选择框输入搜索已有数据
const optionInputSearch = {
methods: {
optionInput(val, opt) {
let componentOptions = opt.componentOptions.children || opt[0].children;
// 循环知道最后一层
while (componentOptions[0].children && componentOptions[0].children.length > 0) {
componentOptions = componentOptions[0].children;
}
return componentOptions[0].text.toLowerCase().indexOf(val) >= 0;
}
}
}
export {
optionInputSearch,
}
vue + Ant Design 表格多选 mixin
vue 富文本图片上传处理
网友评论