UNPKG

dh-c

Version:

The front-end development engineers jimberton gulp react component

43 lines (32 loc) 1.23 kB
## Table 组件的使用 ```jsx import { Table } from 'dh-component'; <Table dataSource={dataSource} columns={columns} bordered fixed striped /> ``` ### Table | props | 说明 | 参数类型 | 默认值 | ------| ------ | ------ | | dataSource | 数据数组 | array | 无 | columns | 表格列的配置描述,具体项见下表 | array | 无 | rowSelection | 列表项是否可选择 | object | 无 | size | 表格尺寸 | string (default, large, small) | default | bordered | 是否显示边框 | bool | false | striped | 是否显示条纹 | bool | true | fixed | 是否固定表头 | bool | false ### columns | props | 说明 | 参数类型 | 默认值 | ------| ------ | ------ | | title | 列头显示文字 | string/ReactNode | 无 | dataIndex | 列数据在数据项中对应的 key | string | 无 | render | 生成复杂数据的渲染函数,参数分别为当前行的值,当前行数据,行索引 | function(text, record, index) | 无 | frozen | 冻结此列 | bool | false ### rowSelection | props | 说明 | 参数类型 | 默认值 | ------| ------ | ------ | | onSelect | 用户手动选择/取消选择某列的回调 | function(record, selected, selectedRows) | 无