Skip to content

Commit

Permalink
translate Table and mark it deprecated, ref ant-design#329
Browse files Browse the repository at this point in the history
  • Loading branch information
warmhug authored and lixiaoyang1992 committed Apr 26, 2018
1 parent eaf27b8 commit 44d7c2b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 27 deletions.
31 changes: 11 additions & 20 deletions components/table/index.en-US.md
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 | - |
16 changes: 9 additions & 7 deletions components/table/index.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
category: Components
type: Data Display
title: Table
title: Table (Deprecated)
subtitle: 表格
---

注意:**不推荐**使用此组件!

由于以下原因:

- table 渲染机制是整块进行,不同于 div 能一点点渲染
Expand All @@ -23,17 +25,17 @@ subtitle: 表格

属性 | 说明 | 类型 | 默认值
----|-----|------|------
| columns | 表格列的配置描述,具体项见下表 | Array | - |
| dataSource | 数据数组 | Array | - |
| direction | 排列方式 horizon/vetical/mix | String | horizon |
| columns | 表格列的配置描述,具体项见下表 | Array | - |
| dataSource | 数据数组 | any[] | - |
| direction | 排列方式 `horizon / vetical / mix` | String | horizon |
| scrollX | 是否横向滚动 | Boolean | false |
| titleFixed | 横向滚动时,标题列是否固定 | Boolean | false |

### columns

属性 | 说明 | 类型 | 默认值
----|-----|------|------
| title | 列头显示文字 | String or React.Element | - |
| key | React 需要的 key,建议设置 | String | - |
| dataIndex | 列数据在数据项中对应的 key,支持 a.b.c 的嵌套写法 | String | - |
| title | 列头显示文字 | string\|ReactNode | - |
| key | React 需要的 key,建议设置 | string | - |
| dataIndex | 列数据在数据项中对应的 key,支持 `a.b.c` 的嵌套写法 | string | - |
| render | 生成复杂数据的渲染函数,参数分别为当前行的值,当前行数据,行索引 | (text, record, index) => React.Node | - |

0 comments on commit 44d7c2b

Please sign in to comment.