Skip to content

Commit 3e617bd

Browse files
authored
docs(table): require Column.key in certain cases (#4019)
Prop `Column.key` is required if using template style api (#2501)
1 parent c0c3b93 commit 3e617bd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

antdv-demo/docs/table/index.en-US.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ One of the Table `columns` prop for describing the table's columns, Column has t
9292
| filterMultiple | Whether multiple filters can be selected | boolean | `true` | |
9393
| filters | Filter menu config | object\[] | - | |
9494
| fixed | Set column to be fixed: `true`(same as left) `'left'` `'right'` | boolean\|string | `false` | |
95-
| key | Unique key of this column, you can ignore this prop if you've set a unique `dataIndex` | string | - | |
95+
| key | Unique key of this column, you can ignore this prop if you're not using [template style api](#components-table-demo-template-style-api) and you've set a unique `dataIndex` | string | - | |
9696
| customRender | Renderer of the table cell. The return value should be a VNode, or an object for colSpan/rowSpan config | Function(text, record, index) {}\|slot-scope | - | |
9797
| sorter | Sort function for local sort, see [Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)'s compareFunction. If you need sort buttons only, set to `true` | Function\|boolean | - | |
9898
| sortOrder | Order of sorted values: `'ascend'` `'descend'` `false` | boolean\|string | - | |

antdv-demo/docs/table/index.zh-CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
| filterMultiple | 是否多选 | boolean | true | |
9393
| filters | 表头的筛选菜单项 | object\[] | - | |
9494
| fixed | 列是否固定,可选 `true`(等效于 left) `'left'` `'right'` | boolean\|string | false | |
95-
| key | Vue 需要的 key,如果已经设置了唯一的 `dataIndex`,可以忽略这个属性 | string | - | |
95+
| key | Vue 需要的 key。如果没有使用 [template 风格的 API](#components-table-demo-template-style-api),且已经设置了唯一的 `dataIndex`,可以忽略这个属性 | string | - | |
9696
| customRender | 生成复杂数据的渲染函数,参数分别为当前行的值,当前行数据,行索引,@return 里面可以设置表格行/列合并,可参考 demo 表格行/列合并 | Function(text, record, index) {}\|slot-scope | - | |
9797
| sorter | 排序函数,本地排序使用一个函数(参考 [Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) 的 compareFunction),需要服务端排序可设为 true | Function\|boolean | - | |
9898
| sortOrder | 排序的受控属性,外界可用此控制列的排序,可设置为 `'ascend'` `'descend'` `false` | boolean\|string | - | |

0 commit comments

Comments
 (0)