Antd的Select如何设置对内容能够筛选 (不是value)

Select组件是按照筛选项的value来筛选的,而我们需要的是按照筛选项的显示的内容来筛选, 这时候该如何设置呢。optionFilterProp=”children”

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<a-form-item
:colon="false"
label="入职公司"
>
<a-select
allowClear
showSearch // 是否支持搜索
optionFilterProp="children" // *把搜索的value换成children
placeholder="请选择"
size="small"
:labelInValue="true"
v-decorator="['companyCode',{rules: [{ required: true, message: '请选择入职公司!' }]}]"
>
<a-select-option
:key="index"
:value="item.code"
v-for="(item, index) in branchAndArea"
>{{item.name}}</a-select-option>
</a-select>
</a-form-item>
#

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×