diff --git a/components/table/index.md b/components/table/index.md index cefdf495bbeceee9a237d0ca46ab5e2950457ce3..b4b39858305429c1029c0a599668dd19833072c0 100644 --- a/components/table/index.md +++ b/components/table/index.md @@ -56,6 +56,32 @@ var dataSource = { | 参数 | 说明 | 类型 | 可选值 | 默认值 | |---------------|--------------------------|-----------------|---------------------|---------| | rowSelection | 列表项是否可选择 | Object | | false | -| pagenation | 分页器 | React.Element | | | +| pagenation | 分页器 | React.Element | 参考 [pagination](/components/pagination),设为 false 时不显示分页 | | | size | 正常或迷你类型 | string | `normal` or `small` | normal | -| dataSource | 数据源 | Array or Object | | | +| dataSource | 数据源,可以为数组(本地模式)或一个数据源描述对象(远程模式) | Array or Object | | | +| columns | 表格列的配置描述,具体项见下表 | Array | | | + +### Column + +列描述数据对象,是 columns 中的一项。 + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|------------|----------------------------|-----------------|---------------------|---------| +| title | 列头显示文字 | String or React.Element | | | +| dataIndex | 列数据在 data 中对应的 key | React.Element | | | +| key | React 需要的 key | String | | | +| render | 生成复杂数据的渲染函数 | Function | | | +| filters | 表头的筛选菜单项 | Array | | | +| onFilter | 本地模式下,确定筛选的运行函数 | Functioni | | | +| sorter | 排序函数,本地模式下为一个函数,远程模式下为布尔值 | Function or Boolean | | | + +### dataSource + +远程数据源配置对象。 + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +|---------------|--------------------------|-----------------|---------------------|---------| +| url | 数据源地址 | String | | | +| resolve | 获得数据的解析函数,接收参数为远程数据返回的 result | Function | | | +| getPagination | 和后台接口返回的分页数据进行适配的函数,返回值会传给表格中的分页器 | Function | | | +| getParams | 和后台接口接收的参数进行适配,返回值会作为请求的参数发送 | Function | | |