跳到主要内容

Type Alias: TXphApiTableProps<T, J, K, L>

TXphApiTableProps<T, J, K, L>: object & Omit<TableProps<T>, "rowSelection" | "columns" | "loading" | "dataSource" | "pagination">

Type declaration

NameTypeDescription
api?(params) => Promise<any>获取datasource的api
autoPagination?boolean是否开启前端自动分页(当api不支持分页时可用)
autoRequest?boolean首次是否自动请求,默认为true
columns?TXphColumnProps<T, J, K>[]列配置项,默认为[]
formatDataSource?(data) => any[]格式化返回的datasource
fullHeight?boolean表格撑满父容器(virtual为true时,默认fullHeight为true),默认为false
onChange?(filters, sorter, extra) => void排序、筛选变化时触发
pagination?false | PaginationProps分页配置(因为分页器是独立出来的,使用table的分页器布局需要修改样式) 默认为{ pageSize: 20, total: 0, showTotal: (total) => 共:${total} 条, current: 1, pageSizeOptions: [10, 20, 50, 100], showSizeChanger: true, showQuickJumper: true, }
requestFields?object分页请求参数中传递到接口的属性名 默认为{ pageSize: "pageSize", current: "current", }
requestFields.current?string-
requestFields.pageSize?string-
responseFields?object响应结果中获取数据的属性名 默认为{ current: "current", list: "data", total: "total", }
responseFields.current?string-
responseFields.list?string-
responseFields.total?string-
rowSelection?RowSelectionType | TableRowSelection<T>单选 / 多选
toolbar?IXphActionsProps<L> | (e) => IXphActionsProps<L>顶部操作栏配置,函数时可以传递参数,参数是什么由调用方决定

Type Parameters

Type ParameterDefault type
TTXphDataSourceItem
J extends TXphExtendComponentPropsMapobject
K extends TXphExtendComponentPropsMapobject
L extends TXphExtendComponentPropsMapobject

Description

扩展antd table的属性

Defined in

packages/table/src/types/apiTable.ts:16