antdv API地址:
https://www.antdv.com/components/select-cn/#API
上代码
template
<template>
<a-select showSearch :filterOption="filterOption">
<a-select-option :value="item.value" :title="item.label" v-for="(item, index) in options"
:key="index">
{{ item.label }}
</a-select-option>
</a-select>
</template>
script
...
data() {
return {
options: [],
filterOption: (input, option) => {
// label搜索
return option.componentOptions.propsData.title.indexOf(input) > -1
}
}
}