forked from ant-design/ant-design-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
translate Table and mark it deprecated, ref ant-design#329
- Loading branch information
1 parent
eaf27b8
commit 44d7c2b
Showing
2 changed files
with
20 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,29 @@ | ||
--- | ||
category: Components | ||
type: Data Display | ||
title: Table | ||
title: Table (Deprecated) | ||
--- | ||
|
||
由于以下原因: | ||
Note: this component has been **deprecated**. Please use `List / ListView` instead. | ||
|
||
- table 渲染机制是整块进行,不同于 div 能一点点渲染 | ||
- table 在修改样式或布局时,非常不方便 | ||
- table 的设计应用的场景非常少 | ||
|
||
所以 **绝大多数情况下、不要使用 table,移动端常见的列表数据、或类似 table 的数据展示需求,使用 List / ListView 组件代替。** | ||
只在如 demo 展示的「锁定标题列」这种极特殊需求情况下使用。 | ||
|
||
> table 实现直接依赖 [rc-table@5](https://github.com/react-component/table) , | ||
使用遇到问题在 [antd issue](https://github.com/ant-design/ant-design/issues) 里查找答案或提问。 | ||
|
||
## API | ||
|
||
Support WEB. | ||
|
||
Properties | Descrition | Type | Default | ||
-----------|------------|------|-------- | ||
| columns | 表格列的配置描述,具体项见下表 | Array | - | | ||
| dataSource | 数据数组 | Array | - | | ||
| direction | 排列方式 horizon/vetical/mix | String | horizon | | ||
| scrollX | 是否横向滚动 | Boolean | false | | ||
| titleFixed | 横向滚动时,标题列是否固定 | Boolean | false | | ||
| columns | columns of table | Array | - | | ||
| dataSource | data record array to be rendered | any[] | - | | ||
| direction | can be `horizon / vetical / mix` | String | horizon | | ||
| scrollX | whether to scroll horizontally | Boolean | false | | ||
| titleFixed | whether the title column is fixed when scrolling horizontally | Boolean | false | | ||
|
||
### columns | ||
|
||
Properties | Descrition | Type | Default | ||
-----------|------------|------|-------- | ||
| title | 列头显示文字 | String or React.Element | - | | ||
| key | React 需要的 key,建议设置 | String | - | | ||
| dataIndex | 列数据在数据项中对应的 key,支持 a.b.c 的嵌套写法 | String | - | | ||
| render | 生成复杂数据的渲染函数,参数分别为当前行的值,当前行数据,行索引 | (text, record, index) => React.Node | - | | ||
| title | title of this column | string\|ReactNode | - | | ||
| key | key of this column | string | - | | ||
| dataIndex | display field of the data record, could be set like `a.b.c` | string | - | | ||
| render | renderer of table cell, has three params: text, record and index of this row. The render value should be a ReactNode | (text, record, index) => React.Node | - | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters