Improve type definition and doc of TableComponents

This commit is contained in:
Wei Zhu 2018-09-25 19:47:34 +08:00
parent 176a8dfcda
commit 306bce385b
4 changed files with 10 additions and 10 deletions

View File

@ -16,7 +16,7 @@ interface BodyRowState {
export interface BodyRowClass extends React.ComponentClass {}
export default function createTableRow(Component = 'tr') {
export default function createTableRow(Component: React.ReactType = 'tr') {
class BodyRow extends React.Component<BodyRowProps, BodyRowState> {
private store: Store;
private unsubscribe: () => void;

View File

@ -55,7 +55,7 @@ const columns = [{
| bordered | Whether to show all table borders | boolean | `false` |
| childrenColumnName | The column contains children to display | string\[] | children |
| columns | Columns of table | [ColumnProps](https://git.io/vMMXC)\[] | - |
| components | Override default table elements | object | - |
| components | Override default table elements | [TableComponents](https://git.io/fANxz) | - |
| dataSource | Data record array to be displayed | any\[] | - |
| defaultExpandAllRows | Expand all rows initially | boolean | `false` |
| defaultExpandedRowKeys | Initial expanded row keys | string\[] | - |

View File

@ -60,7 +60,7 @@ const columns = [{
| bordered | 是否展示外边框和列边框 | boolean | false |
| childrenColumnName | 指定树形结构的列名 | string\[] | children |
| columns | 表格列的配置描述,具体项见下表 | [ColumnProps](https://git.io/vMMXC)\[] | - |
| components | 覆盖默认的 table 元素 | object | - |
| components | 覆盖默认的 table 元素 | [TableComponents](https://git.io/fANxz) | - |
| dataSource | 数据数组 | any\[] | |
| defaultExpandAllRows | 初始时,是否展开所有行 | boolean | false |
| defaultExpandedRowKeys | 默认展开的行 | string\[] | - |

View File

@ -37,16 +37,16 @@ export interface ColumnProps<T> {
}
export interface TableComponents {
table?: any;
table?: React.ReactType;
header?: {
wrapper?: any;
row?: any;
cell?: any;
wrapper?: React.ReactType;
row?: React.ReactType;
cell?: React.ReactType;
};
body?: {
wrapper?: any;
row?: any;
cell?: any;
wrapper?: React.ReactType;
row?: React.ReactType;
cell?: React.ReactType;
};
}