<a-select
show-search
v-model="expressCom"
placeholder="input search text"
style="width: 100%"
:default-active-first-option="true"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
@search="handleExpressSearch"
@change="handleExpressChange"
@blur="handleExpressBlur"
>
<a-select-option
v-for="(item, index) in expressList"
:key="'express_' + index"
:value="item"
>
{{ item }}
</a-select-option>
</a-select>
data(){
return {
expressCom:"",
expressList: [],
}
},
methods: {
handleExpressBlur(value) {
this.handleExpressChange(value);
},
handleExpressSearch(value) {
this.handleExpressChange(value);
},
handleExpressChange(value) {
this.expressCom = value;
this.getExpress({ name: value });
},
}
ant-design <a-select> 组件远程搜索实现可输入可搜索。