單選模式搜索選中
https://www.antdv.com/components/select-cn/#API
主要用到的api
主要代碼
組件
<a-select
mode="multiple"
:value="form.role"
style="width: 100%"
:showArrow="true"
//filterOption 觸發輸入過濾
:filterOption="selectInput"
placeholder="請選擇角色"
@change="changeRole"
>
method
//下拉選擇,輸入過濾
selectInput(inputValue, option){
//console.log(inputValue, option,111111)
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0
);
},
效果