RichTableProps interface
RichTable 组件属性
Signature
interface RichTableProps<T extends Record<string, any> = Record<string, any>>Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
boolean | BorderConfig | (Optional) 边框:true = 全边框,object = 精细控制 | ||
string | (Optional) 容器类名 | ||
ClipboardConfig | true | (Optional) 剪贴板(粘贴/剪切) | ||
ColumnResizeConfig | true | (Optional) 列宽拖拽 | ||
ColumnDefOrGroup<T>[] | 列定义 | ||
(Optional) 自定义表头(列可见性) | |||
T[] | 行数据 | ||
DragSortConfig | true | (Optional) 拖拽排序 | ||
(Optional) 单元格编辑 | |||
string | (Optional) 空数据提示文本,默认 "暂无数据" | ||
FilteringConfig | true | (Optional) 筛选 | ||
(Optional) 固定列 | |||
boolean | (Optional) 是否固定表头,默认 true | ||
number | (Optional) 表头高度,默认 32 | ||
number | string | (Optional) 容器高度 | ||
KeyboardConfig | true | (Optional) 键盘导航 | ||
boolean | (Optional) 加载中状态 | ||
(info: { data: T[]; checked: boolean }) => void | (Optional) 全选/取消全选通知 | ||
(info: CellClickInfo<T>) => void | (Optional) 单元格点击 | ||
(info: { checkedRows: T[]; checkedKeys: string[]; detail: CheckChangeDetail }) => void | (Optional) 勾选变更通知 | ||
(info: { colKey: string; width: number }) => void | (Optional) 列宽变更通知 | ||
(info: { data: T[]; changedRow?: T; type?: DataChangeType }) => void | (Optional) 数据变更通知 | ||
(info: { fromIndices: number | number[]; toIndex: number; currentIndices: number | number[] }) => void | (Optional) 拖拽排序结束通知 | ||
(info: { row: T; colKey: string; value: any; oldValue: any }) => void | (Optional) 编辑提交通知 | ||
(cell: CellCoord | null) => void | (Optional) 编辑状态变更通知 | ||
(info: { message: string }) => void | (Optional) 错误回调 | ||
(filters: Record<string, string>) => void | (Optional) 筛选变更通知 | ||
(colKey: string) => void | (Optional) 表头右键菜单 | ||
(info: { row: T; index: number }) => void | (Optional) 行单击 | ||
(info: { row: T; index: number }) => void | (Optional) 行右键菜单 | ||
(info: { row: T; index: number }) => void | (Optional) 行双击 | ||
(info: { row: T; index: number }) => void | (Optional) 行鼠标进入 | ||
(info: { row: T; index: number }) => void | (Optional) 行鼠标离开 | ||
(info: { selectedKeys: string[]; selectedRows: T[] }) => void | (Optional) 选择变更通知 | ||
(sort: SortState[]) => void | (Optional) 排序变更通知 | ||
number | (Optional) 行高,默认 28 | ||
boolean | (Optional) 行悬浮高亮,默认 false | ||
keyof T | ((row: T, index: number) => string) | (Optional) 行唯一标识字段或提取函数,默认 'id' | ||
string | (Optional) 搜索高亮词(对单元格文本大小写不敏感全匹配高亮) | ||
SelectionConfig | true | (Optional) 行选择 | ||
boolean | (Optional) 是否显示表头,默认 true | ||
boolean | (Optional) 是否显示行号列 | ||
SortingConfig | true | (Optional) 排序 | ||
boolean | (Optional) 斑马纹 | ||
Record<string, string | number> | (Optional) 容器样式 | ||
Record<string, string> | (Optional) 表体样式 | ||
(Optional) 全局文本对齐(列的 align 优先级更高) | |||
VirtualScrollConfig | true | (Optional) 虚拟滚动(仅固定行高,非动态测量)。 ⚠️ 约束:开启后每行高度恒等于 rowHeight,单元格换行会撑高行导致定位错位。 因此所有可能超长换行的列必须配 | ||
number | string | (Optional) 容器宽度 |