antd vue select选择器的使用

单选模式搜索选中

https://www.antdv.com/components/select-cn/#API

主要用到的api

image-20201208104807867

主要代码

组件
<a-select
        mode="multiple"
        :value="form.role"
        style=" 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
    );
},

效果

image-20201208105614471

原文地址:https://www.cnblogs.com/makalochen/p/14101480.html