API

React 表组件 <Badge>@antv/s2-react</Badge>
SpreadsheetProps

功能描述: React SheetComponent 组件的 props 参数

参数说明类型默认值必选
sheetType表格类型:
1. pivot: 透视表
2. table: 明细表
3. gridAnalysis: 网格分析表
4. strategy: 趋势分析表
5. editable: 编辑表
pivot | table | gridAnalysis | strategy | editablepivot
spreadsheet自定义表(container: HTMLElement | string, dataCfg: S2DataConfig, options: SheetComponentOptions) => SpreadSheet
dataCfg透视表数据映射相关配置项S2DataConfig✓
options透视表属性配置项SheetComponentOptions✓
partDrillDown维度下钻相关属性PartDrillDown
adaptive是否根据窗口大小自适应boolean | { width?: boolean, height?: boolean, getContainer: () => HTMLElement }false
themeCfg自定义透视表主题样式ThemeCfg
loading控制表格的加载状态boolean
header表头配置项HeaderCfgProps
onRangeSort组内排序时触发回调事件(params: SortParam[] ) => void;
onRowCellHover行头鼠标悬停事件(data: TargetCellInfo) => void
onRowCellClick行头鼠标单击事件(data: TargetCellInfo) => void
onRowCellDoubleClick行头鼠标双击事件(data: TargetCellInfo) => void
onRowCellContextMenu行头右键菜单事件(data: TargetCellInfo) => void
onRowCellMouseDown行头鼠标按下事件(data: TargetCellInfo) => void
onRowCellMouseUp行头鼠标放开事件(data: TargetCellInfo) => void
onRowCellMouseMove行头鼠标移动事件(data: TargetCellInfo) => void
onRowCellCollapsed节点展开/收起事件回调({ isCollapsed: boolean, collapseFields: Record<string, boolean>, node: Node }) => void;
onRowCellAllCollapsed节点全部展开/收起的事件回调(isCollapsed: boolean ) => void;
onRowCellScroll行头单元格滚动事件({position: CellScrollPosition} ) => void;
onRowCellRender行头单元格渲染事件( cell: Cell ) => void
onRowCellSelected行头单元格选中事件( cells: Cell[], detail: CellSelectedDetail ) => void
onColCellHover列头鼠标悬停事件(data: TargetCellInfo) => void
onColCellClick列头鼠标单击事件(data: TargetCellInfo) => void
onColCellDoubleClick列头鼠标双击事件(data: TargetCellInfo) => void
onColCellContextMenu列头右键菜单事件(data: TargetCellInfo) => void
onColCellMouseDown列头鼠标按下事件(data: TargetCellInfo) => void
onColCellMouseUp列头鼠标松开事件(data: TargetCellInfo) => void
onColCellMouseMove列头鼠标移动事件(data: TargetCellInfo) => void
onColCellExpanded开启隐藏列头(tooltip.operation.hiddenColumns = true)后,列头展开的事件回调(expandedNode: Node) => void;
onColCellHidden开启隐藏列头(tooltip.operation.hiddenColumns = true)后,列头隐藏的事件回调( data: { currentHiddenColumnsInfo:HiddenColumnsInfo; hiddenColumnsDetail:HiddenColumnsInfo[]} ) => void;
onColCellRender列头单元格渲染事件( cell: Cell ) => void
onColCellSelected列头单元格选中事件( cells: Cell[], detail: CellSelectedDetail ) => void
onDataCellHover数值单元格鼠标悬停事件(data: TargetCellInfo) => void
onDataCellClick数值单元格鼠标点击事件(data: TargetCellInfo) => void
onDataCellDoubleClick数值单元格双击事件(data: TargetCellInfo) => void
onDataCellContextMenu数值单元格右键菜单事件(data: TargetCellInfo) => void
onDataCellMouseDown数值单元格鼠标按下事件(data: TargetCellInfo) => void
onDataCellMouseUp数值单元格鼠标松开事件(data: TargetCellInfo) => void
onDataCellMouseMove数值单元格鼠标移动事件(data: TargetCellInfo) => void
onDataCellBrushSelection数值单元格刷选事件( dataCells: DataCell[] ) => void
onDataCellSelectMove数值单元格键盘方向键移动事件(metas: CellMeta[]) => void
onDataCellEditStart数值单元格编辑开始(暂只支持编辑表)(meta: ViewMeta, cell: S2CellType) => void
onDataCellEditEnd数值单元格编辑完成(暂只支持编辑表)(meta: ViewMeta, cell: S2CellType) => void
onDataCellRender数值单元格渲染事件( cell: Cell ) => void
onDataCellSelected数值单元格选中事件( cells: Cell[], detail: CellSelectedDetail ) => void
onCornerCellHover角头鼠标悬停事件(data: TargetCellInfo) => void
onCornerCellClick角头鼠标单击事件(data: TargetCellInfo) => void
onCornerCellDoubleClick角头鼠标双击事件(data: TargetCellInfo) => void
onCornerCellContextMenu角头右键菜单事件(data: TargetCellInfo) => void
onCornerCellMouseUp角头鼠标按下事件(data: TargetCellInfo) => void
onCornerCellMouseUp角头鼠标松开事件(data: TargetCellInfo) => void
onCornerCellMouseMove角头鼠标移动事件(data: TargetCellInfo) => void
onCornerCellRender角头单元格渲染事件( cell: Cell ) => void
onCornerCellSelected角头单元格选中事件( cells: Cell[], detail: CellSelectedDetail ) => void
onMergedCellsHover合并单元格鼠标悬停事件(data: TargetCellInfo) => void
onMergedCellsClick合并单元格鼠标点击事件(data: TargetCellInfo) => void
onMergedCellsDoubleClick合并单元格鼠标双击事件(data: TargetCellInfo) => void
onMergedCellsContextMenu合并单元格右键菜单事件(data: TargetCellInfo) => void
onMergedCellsMouseDown合并单元格按下事件(data: TargetCellInfo) => void
onMergedCellsMouseUp合并单元格松开事件(data: TargetCellInfo) => void
onMergedCellsMouseMove合并单元格移动事件(data: TargetCellInfo) => void
onMergedCellsRender合并单元格渲染事件( cell: Cell ) => void
onSeriesNumberCellRender序号单元格渲染事件( cell: Cell ) => void
onRangeSort组内排序时触发回调事件(暂只支持透视表)(params: SortParam[] ) => void;
onRangeSorted组内排序结束触发回调事件(暂只支持透视表)(event: FederatedPointerEvent ) => void;
onRangeFilter筛选时触发回调事件(data: { filterKey: string; filteredValues: string[] } ) => void;
onRangeFiltered筛选结束触发回调事件(data: DataType[] ) => void;
onLayoutCellRender单个单元格布局渲染完成事件cell: S2CellType
onLayoutAfterHeaderLayout表头布局结构准备完成事件(layoutResult: LayoutResult ) => void;
onLayoutPagination分页事件({ pageSize: number; pageCount: number; total: number; current: number;} ) => void;
onLayoutCellScroll单元格滚动事件 (已废弃,请使用 onScroll 代替)({position: CellScrollPosition} ) => void;
onLayoutAfterCollapseRows树状模式下收起行头后的事件回调({ collapseFields: Record<string, boolean>, meta: Node }) => void;
onBeforeRender开始 render 前的事件() => void;
onAfterRenderrender 完成的事件() => void;
onMounted组件层表格挂载完成事件,可拿到表实例 详情(spreadsheet: SpreadSheet) => void;
onUpdate组件层表格更新事件,当 数据 (S2DataConfig) 或 配置 (S2Options) 更新时触发,可手动控制更新时的 渲染模式(renderOptions: S2RenderOptions) => S2RenderOptions | void
onUpdateAfterRender组件层表格更新事件,当 数据 (S2DataConfig) 或 配置 (S2Options) 更新时,并且在重渲染 s2.render() 完成后触发(renderOptions: S2RenderOptions) => void
onLoading组件层加载状态变更事件(loading: boolean) => void
onDestroy表格销毁事件() => void;
onLayoutResize表格整体 changeSize 事件(params: ResizeParams) => void;
onLayoutResizeSeriesWidth表格序号行宽事件(params: ResizeParams) => void;
onLayoutResizeRowWidth行头单元格宽度更改事件(params: ResizeParams) => void;
onLayoutResizeRowHeight行头单元格高度更改事件(params: ResizeParams) => void;
onLayoutResizeColWidth列头单元格宽度更改事件(params: ResizeParams) => void;
onLayoutResizeColHeight列头单元格高度更改事件(params: ResizeParams) => void;
onLayoutResizeTreeWidth树状行头整体宽度更改事件(params: ResizeParams) => void;
onLayoutResizeMouseDownresize 热区鼠标按下事件( event: MouseEvent, resizeInfo?: ResizeInfo) => void;
onLayoutResizeMouseUpresize 热区鼠标松开事件( event: MouseEvent, resizeInfo?: ResizeInfo) => void;
onLayoutResizeMouseMoveresize 热区鼠标移动事件( event: MouseEvent, resizeInfo?: ResizeInfo) => void;
onKeyBoardDown键盘按下事件(event: KeyboardEvent) => void
onKeyBoardUp键盘松开事件(event: KeyboardEvent) => void
onCopied复制事件(data: CopyableList) => void
onActionIconHover行头操作 icon 悬停事件(event: FederatedPointerEvent) => void
onActionIconClick行头操作 icon 点击事件(event: FederatedPointerEvent) => void
onContextMenu右键单元格单击事件 (禁用右键菜单不生效?)(event: FederatedPointerEvent) => void
onMouseHover表格鼠标悬停事件(event: FederatedPointerEvent) => void
onMouseUp表格鼠标松开事件(event: FederatedPointerEvent) => void
onSelected单元格选中事件(cells: Cell[], detail: CellSelectedDetail ) => void
onReset交互状态重置事件(event: KeyboardEvent) => void
onLinkFieldJump链接字段跳转事件(data: { field: string; meta: Node | ViewMeta; record: Data }) => void
onScroll单元格滚动事件 (含行头和数值单元格)({position: CellScrollPosition} ) => void
onColCellBrushSelection批量选中刷选范围内的列头单元格,刷选过程中,显示刷选范围提示蒙层,刷选完成后,弹出 tooltip, 展示被刷选单元格信息(cells: ColCell[]) => void;
onRowCellBrushSelection批量选中刷选范围内的行头单元格,刷选过程中,显示刷选范围提示蒙层,刷选完成后,弹出 tooltip, 展示被刷选单元格信息(仅支持透视表)(cells: RowCell[]) => void;
SheetComponentOptions
Vue 表组件 <Badge type="success">@antv/s2-vue</Badge>
公共对象
ViewMeta
Interaction