diff --git a/packages/s2-core/src/sheet-type/spread-sheet.ts b/packages/s2-core/src/sheet-type/spread-sheet.ts index 1a87f230ba..c1acbd81dc 100644 --- a/packages/s2-core/src/sheet-type/spread-sheet.ts +++ b/packages/s2-core/src/sheet-type/spread-sheet.ts @@ -394,15 +394,18 @@ export abstract class SpreadSheet extends EE { this.initTooltip(); } - /** - * 配置都是 merge 操作, 但是隐藏列配置比较特殊, 变更时, 应该是全量覆盖, 而不应该是合并 - * https://github.com/antvis/S2/issues/2495 - */ + this.resetHiddenColumnsDetailInfoIfNeeded(); + this.registerIcons(); + } + + /** + * 配置都是 merge 操作, 但是隐藏列配置比较特殊, 变更时, 应该是全量覆盖, 而不应该是合并 + * https://github.com/antvis/S2/issues/2495 + */ + private resetHiddenColumnsDetailInfoIfNeeded() { if (!isEmpty(this.options.interaction?.hiddenColumnFields)) { this.store.set('hiddenColumnsDetail', []); } - - this.registerIcons(); } public render(reloadData = true, options: S2RenderOptions = {}) {