Skip to content

Commit

Permalink
test: 单测修复
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed Aug 22, 2024
1 parent e6a466b commit de1cc8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/s2-core/src/facet/pivot-facet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class PivotFacet extends FrozenFacet {
/**
* 根据行列索引获取单元格元数据
*/
public getCellMeta(rowIndex: number, colIndex: number) {
public getCellMeta(rowIndex: number = 0, colIndex: number = 0) {
const { options, dataSet } = this.spreadsheet;
const { rowLeafNodes, colLeafNodes } = this.getLayoutResult();
const row = rowLeafNodes[rowIndex];
Expand Down
5 changes: 2 additions & 3 deletions packages/s2-core/src/facet/table-facet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Group, Rect } from '@antv/g';
import {
isBoolean,
isEmpty,
isNil,
isNumber,
keys,
last,
Expand Down Expand Up @@ -359,12 +358,12 @@ export class TableFacet extends FrozenFacet {
};
}

public getCellMeta(rowIndex: number, colIndex: number) {
public getCellMeta(rowIndex: number = 0, colIndex: number = 0) {
const { options, dataSet } = this.spreadsheet;
const colLeafNodes = this.getColLeafNodes();
const colNode = colLeafNodes[colIndex];

if (isNil(rowIndex) || !colNode) {
if (!colNode) {
return null;
}

Expand Down

0 comments on commit de1cc8a

Please sign in to comment.