Skip to content

Commit 25e1774

Browse files
committed
fix: 表头吸顶主题同步
1 parent c8fbabe commit 25e1774

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

  • packages/s2-core/src/ui/sticky-header

‎packages/s2-core/src/ui/sticky-header/index.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,19 @@ export class StickyHeaderController {
235235
) => SpreadSheet;
236236

237237
this.stickyS2 = new SheetClass(this.stickyContainer, dataCfg, options);
238+
this.syncTheme();
239+
}
240+
241+
/**
242+
* 同步主表主题到吸顶实例
243+
*/
244+
private syncTheme() {
245+
if (!this.stickyS2) {
246+
return;
247+
}
248+
249+
this.stickyS2.setThemeCfg({ name: this.spreadsheet.themeName });
250+
this.stickyS2.theme = this.spreadsheet.theme;
238251
}
239252

240253
/**
@@ -503,6 +516,7 @@ export class StickyHeaderController {
503516

504517
this.stickyS2.setDataCfg(dataCfg);
505518
this.stickyS2.setOptions(options);
519+
this.syncTheme();
506520

507521
// 调整画布大小到表头大小
508522
const mainConfig = spreadsheet.getCanvasConfig();

0 commit comments

Comments
 (0)