Skip to content

Commit

Permalink
📝 Add documentation for LocaleProvider and List
Browse files Browse the repository at this point in the history
close #17399
  • Loading branch information
afc163 committed Jul 6, 2019
1 parent 0f6b8c8 commit e9b370d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/list/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ A list can be used to display content related to a single subject. The content c
| locale | i18n text including empty text | object | emptyText: 'No Data' <br> |
| pagination | Pagination [config](https://ant.design/components/pagination/), hide it by setting it to false | boolean \| object | false |
| split | Toggles rendering of the split under the list item | boolean | true |
| dataSource | dataSource array for list | any[] | - |
| renderItem | customize list item when using `dataSource` | `item => ReactNode` | - |

### pagination

Expand Down
2 changes: 2 additions & 0 deletions components/list/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ cols: 1
| pagination | 对应的 `pagination` 配置, 设置 `false` 不显示 | boolean\|object | false |
| size | list 的尺寸 | `default` \| `middle` \| `small` | `default` |
| split | 是否展示分割线 | boolean | true |
| dataSource | 列表数据源 | any[] | - |
| renderItem | 当使用 dataSource 时,可以用 `renderItem` 自定义渲染列表项 | `item => ReactNode` | - |

### pagination

Expand Down
6 changes: 6 additions & 0 deletions components/locale-provider/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ This component aims to provide localization of the built-in text. If you want to
| Property | Description | Type | Default |
| --- | --- | --- | --- |
| locale | language package setting, you can find the packages in [antd/lib/locale-provider](http://unpkg.com/antd/lib/locale-provider/) | object | - |

## FAQ

#### Locale problem is still existed even LocaleProvider is used?

Please make sure you set moment locale by `moment.locale('zh-cn')`, or you don't have two moment of different version.
6 changes: 6 additions & 0 deletions components/locale-provider/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,9 @@ return <LocaleProvider locale={locales.en_US}><App /></LocaleProvider>;
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| locale | 语言包配置,语言包可到 [antd/lib/locale-provider](http://unpkg.com/antd/lib/locale-provider/) 目录下寻找 | object | - |

## FAQ

#### 为什么我使用了 LocaleProvider 还有问题?

请检查是否设置了 `moment.locale('zh-cn')`,或者是否有两个版本的 moment 共存。

0 comments on commit e9b370d

Please sign in to comment.