TablePro
TablePro 组件是对 ant-design-vue 的 Table 的二次封装的组件,内置 selection 以及 拖拽排序
Props
| 属性 | 类型 | 描述 |
|---|---|---|
| columns | Columns | 表格的列配置 |
| bordered | boolean | 是否显示边框 |
| total | number | 数据总数 |
| dataSource | Array<any> | 表格的数据源 |
| loadData | (params: {current: number, pageSize: number}) => void | 加载数据的函数 |
| rowSelection | RowSelection | null |
| rowKey | string | 行的唯一标识的键名 |
| pagination | Pagination | 分页配置 |
RowSelection
ts
interface RowSelection<T, K> {
selectedRowKeys: K[]
selectedRows: T[]
onChange: (selectedRowKeys: K[], selectedRows: T[]) => void
}Pagination
ts
interface Pagination {
showSizeChanger: boolean
showQuickJumper: boolean
showTotal: (total: number) => string
onChange: (page: number, pageSize: number) => void
onShowSizeChange: (current: number, size: number) => void
}