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>

antd中的form表单initialValue导致数据不更新问题

前言

初步理解 : initialValue就是所谓的defaultValue,只会在第一次赋值的时候改变,却又有一些不同,因为 initialValue又会因其他改动而改变。 然而当获取的数据重新上来要渲染的时候 ,initialValue的值却又不改变,所以 让人觉得很是捉摸不透。

antd-vue中给table表格整行加点击事件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<a-table
:columns="columns"
:dataSource="data"
:loading="loading"
:pagination="pagination"
:rowKey="record => record.id"
@change="paginationChange"
bordered
:customRow="click" // 这个是重点,主要是给table添加属性的作用
>

// 内容

</a-table>
Your browser is out-of-date!

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

×