From 9197f69be08b8104b000df4c022707c696d0e725 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 21 Jan 2024 12:29:42 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E5=BD=93=E5=89=8D=20tab=20=E6=B0=B8?= =?UTF-8?q?=E8=BF=9C=E4=B8=BA=E6=9C=80=E5=90=8E=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/layout/util.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index 25fb153f1..a3f1c30b0 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -443,9 +443,6 @@ export const JSONToLayout = (app: App, isStart: boolean) => { } /// #endif } - app.plugins.forEach(item => { - afterLoadPlugin(item); - }); // 移除没有插件的 tab document.querySelectorAll('li[data-type="tab-header"]').forEach((item: HTMLElement) => { const initData = item.getAttribute("data-initdata"); @@ -484,6 +481,10 @@ export const JSONToLayout = (app: App, isStart: boolean) => { tab.parent.switchTab(item, false, false, true, false); }); } + // 需放在 tab.parent.switchTab 后,否则当前 tab 永远为最后一个 + app.plugins.forEach(item => { + afterLoadPlugin(item); + }); resizeTopBar(); };