使用vue-ant-design select呈现可搜索的select下拉列表
从文档中,我编写了以下组件
<template>
<a-select
showSearch
placeholder="Select a person"
optionFilterProp="children"
style="width: 200px"
@focus="handleFocus"
@blur="handleBlur"
@change="handleChange"
:filterOption="filterOption"
>
<a-select-option value="jack">Jack</a-select-option>
<a-select-option value="lucy">Lucy</a-select-option>
<a-select-option value="tom">Tom</a-select-option>
</a-select>
</template>
<script>
export default {
methods: {
handleChange(value) {
console.log(`selected ${value}`);
},
handleBlur() {
console.log('blur');
},
handleFocus() {
console.log('focus');
},
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
},
},
};
</script>
选择选项后,焦点无法工作。该如何解决?