Skip to content

Commit 5b31fc0

Browse files
richardo2016youluna
authored andcommitted
fix(Table/List): correct signature of loadingComponent
- Table's loadingComponent - List's loadingComponent
1 parent bf8b879 commit 5b31fc0

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

docs/list/index.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The content can consist of multiple elements of varying type and size.
2929
| dataSource | datasource of List | Array | - |
3030
| renderItem | when dataSource is set, you can custmize every item by `renderItem` <br><br>**signature**:<br>Function(current: Any, index: Number) => void<br>**params**:<br>_current_: {Any} current item<br>_index_: {Number} index of item | Function | item => item |
3131
| loading | is loading | Boolean | false |
32-
| loadingComponent | custmize Loading Component<br> loadingComponent={props => &lt;Loading {...props}/>}<br><br>**signature**:<br>Function() => void | Function | - |
32+
| loadingComponent | custmize Loading Component<br> loadingComponent={props => &lt;Loading {...props}/>}<br><br>**signature**:<br>Function(props: LoadingProps) => React.ReactNode | Function | - |
3333
| emptyContent | content when list is empty | ReactNode | - |
3434

3535

docs/list/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
| dataSource | 列表数据源 | Array | - |
2929
| renderItem | 当使用 dataSource 时,可以用 renderItem 自定义渲染列表项<br><br>**签名**:<br>Function(current: Any, index: Number) => void<br>**参数**:<br>_current_: {Any} 当前遍历的项<br>_index_: {Number} 当前遍历的项的索引 | Function | item => item |
3030
| loading | 是否在加载中 | Boolean | false |
31-
| loadingComponent | 自定义 Loading 组件<br>请务必传递 props, 使用方式: loadingComponent={props => &lt;Loading {...props}/>}<br><br>**签名**:<br>Function() => void | Function | - |
31+
| loadingComponent | 自定义 Loading 组件<br>请务必传递 props, 使用方式: loadingComponent={props => &lt;Loading {...props}/>}<br><br>**签名**:<br>(props: LoadingProps) => React.ReactNode | Function | - |
3232
| emptyContent | 设置数据为空的时候的表格内容展现 | ReactNode | - |
3333

3434
### List.Item

docs/table/index.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ ReactDOM.render(
9999
| hasHeader | whether the table has header | Boolean | true |
100100
| isZebra | whether the table has zebra style | Boolean | false |
101101
| loading | whether data is loading | Boolean | false |
102-
| loadingComponent | customized Loading component <br><br>**signatures**:<br>Function() => void | Function | - |
102+
| loadingComponent | customized Loading component <br><br>**signatures**:<br>(props: LoadingProps) => React.ReactNode | Function | - |
103103
| filterParams | currently filtered keys, use this property to control which menu in the table's header filtering options is selected, in the format {dataIndex: {selectedKeys:\[]}}<br> Example: <br> Suppose you want to control dataIndex as Select <br><Table filterParams={{id: {selectedKeys: ['one']}}}/> for the menu item whose key is one in the filtering menu of the id column. | Object | - |
104104
| sort | the currently sorted field, use this property to control the sorting of the table's fields in the format {dataIndex: 'asc'} | Object | - |
105105
| sortIcons | customize sortIcons, to set top and bottom layout e.g.`{desc: <Icon style={{top: '6px', left: '4px'}} type={'arrow-down'} size="small" />, asc: <Icon style={{top: '-6px', left: '4px'}} type={'arrow-up'} size="small" />}` | Object | - |

docs/table/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ ReactDOM.render(
111111
| hasHeader | 表格是否具有头部 | Boolean | true |
112112
| isZebra | 表格是否是斑马线 | Boolean | false |
113113
| loading | 表格是否在加载中 | Boolean | false |
114-
| loadingComponent | 自定义 Loading 组件<br>请务必传递 props, 使用方式: loadingComponent={props => &lt;Loading {...props}/>}<br><br>**签名**:<br>Function(props: Object) => void<br>**参数**:<br>_props_: {Object} 当前点击行的key | Function | - |
114+
| loadingComponent | 自定义 Loading 组件<br>请务必传递 props, 使用方式: loadingComponent={props => &lt;Loading {...props}/>}<br><br>**签名**:<br>Function(props: LoadingProps) => React.ReactNode<br>**参数**:<br>_props_: {Object} 当前点击行的key | Function | - |
115115
| filterParams | 当前过滤的的keys,使用此属性可以控制表格的头部的过滤选项中哪个菜单被选中,格式为 {dataIndex: {selectedKeys:\[]}}<br>示例:<br>假设要控制dataIndex为id的列的过滤菜单中key为one的菜单项选中<br>`<Table filterParams={{id: {selectedKeys: ['one']}}}/>` | Object | - |
116116
| sort | 当前排序的字段,使用此属性可以控制表格的字段的排序,格式为{dataIndex: 'asc'} | Object | - |
117117
| sortIcons | 自定义排序按钮,例如上下排布的: `{desc: <Icon style={{top: '6px', left: '4px'}} type={'arrow-down'} size="small" />, asc: <Icon style={{top: '-6px', left: '4px'}} type={'arrow-up'} size="small" />}` | Object | - |

types/list/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export interface ListProps extends React.HTMLAttributes<HTMLElement>, CommonProp
4141
* 自定义 Loading 组件
4242
* 请务必透传 props, 使用方式: loadingComponent={props => <Loading {...props}/>}
4343
*/
44-
loadingComponent?: (props: LoadingProps) => void;
44+
loadingComponent?: (props: LoadingProps) => ReactNode;
4545
emptyContent?: ReactNode;
4646
}
4747

types/table/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ export interface TableProps extends React.HTMLAttributes<HTMLElement>, CommonPro
232232
* 自定义 Loading 组件
233233
* 请务必传递 props, 使用方式: loadingComponent={props => <Loading {...props}/>}
234234
*/
235-
loadingComponent?: (props: LoadingProps) => void;
235+
loadingComponent?: (props: LoadingProps) => React.ReactNode;
236236

237237
/**
238238
* 当前过滤的的keys,使用此属性可以控制表格的头部的过滤选项中哪个菜单被选中,格式为 {dataIndex: {selectedKeys:[]}}

0 commit comments

Comments
 (0)