From 7da3a6285250660b9eb817188283def0c5b09604 Mon Sep 17 00:00:00 2001 From: Allen Date: Sun, 18 May 2025 19:46:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=90=E8=A1=8C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=94=9F=E4=BA=A7=E6=A8=A1=E5=BC=8F=E6=89=93=E5=8C=85?= =?UTF-8?q?=E7=9A=84=E7=A8=8B=E5=BA=8F=EF=BC=8C=E8=BF=9B=E5=85=A5=E4=B8=BB?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=97=B6=EF=BC=8C=E6=8F=90=E7=A4=BA=E6=89=BE?= =?UTF-8?q?=E4=B8=8D=E5=88=B0electron-tabs.js=E6=96=87=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 4 +++- src/index.ts | 5 +---- vite.renderer.config.ts | 9 +++++++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index d4348e1..2c07717 100644 --- a/index.html +++ b/index.html @@ -50,7 +50,9 @@ 帮助图标 - + diff --git a/src/index.ts b/src/index.ts index 935cc4e..043babc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -245,10 +245,7 @@ function bindHelpIconClickEvent(menuItem: MenuItem): void { if (tab) { tab.activate(); } else { - const newTab: Tab | null = await addTabAsync(tabGroup, menuItem); - if (newTab) { - newTab.setPosition(0); - } + await addTabAsync(tabGroup, menuItem); } } }); diff --git a/vite.renderer.config.ts b/vite.renderer.config.ts index 4a6488d..39ca66f 100644 --- a/vite.renderer.config.ts +++ b/vite.renderer.config.ts @@ -20,9 +20,18 @@ export default defineConfig({ input: { login: 'login.html', index: 'index.html' + }, + output: { + // 确保 electron-tabs.js 被正确打包 + manualChunks: { + 'electron-tabs': ['electron-tabs'] + } } } }, + optimizeDeps: { + include: ['electron-tabs'] + }, // 使用 Vite 的 env 配置 envPrefix: ['EIAC_DESKTOP_API_HOST', 'NODE_ENV'], // 定义环境变量