From 18414837e60ca68f7cb040272dd42c380e26403d Mon Sep 17 00:00:00 2001 From: leijun Date: Wed, 23 Aug 2023 16:47:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=BC=E5=85=A5=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=B7=BB=E5=8A=A0=E6=97=B6=E6=9C=BA=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ExcelView.ts | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/ExcelView.ts b/src/ExcelView.ts index 3414ba5..269117f 100644 --- a/src/ExcelView.ts +++ b/src/ExcelView.ts @@ -61,23 +61,6 @@ export class ExcelView extends TextFileView { this.handleFile.bind(this), false ); - - // 添加顶部导入按钮 - if (!this.importEle) { - this.importEle = this.addAction( - "download", - "import xlsx file", - (ev) => this.handleImportClick(ev) - ); - } - - if (!this.exportEle) { - this.exportEle = this.addAction( - "upload", - "export xlsx file", - (ev) => this.handleExportClick(ev) - ); - } } // 处理顶部导入按钮点击事件 @@ -121,6 +104,19 @@ export class ExcelView extends TextFileView { typeof this.containerEl.onWindowMigrated === "undefined" ); this.ownerWindow = this.containerEl.win; + + // 添加顶部导入按钮 + this.importEle = this.addAction( + "download", + "import xlsx file", + (ev) => this.handleImportClick(ev) + ); + + this.exportEle = this.addAction( + "upload", + "export xlsx file", + (ev) => this.handleExportClick(ev) + ); } clear(): void {