From 7c45aeb86886edfd901940f7ec88c169eee4c133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=A0=E8=90=9D=E5=90=B9=E9=9B=AA?= <58333667+yuguaa@users.noreply.github.com> Date: Wed, 16 Oct 2024 21:06:37 +0800 Subject: [PATCH] fix: tabView title internationalization switchover problem (#4652) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当tabView被固定或取消固定后,切换国际化,该tabView的title国际化切换失败 --- packages/stores/src/modules/tabbar.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/stores/src/modules/tabbar.ts b/packages/stores/src/modules/tabbar.ts index 80d8853c..e2b6d025 100644 --- a/packages/stores/src/modules/tabbar.ts +++ b/packages/stores/src/modules/tabbar.ts @@ -306,7 +306,9 @@ export const useTabbarStore = defineStore('core-tabbar', { (item) => getTabPath(item) === getTabPath(tab), ); if (index !== -1) { + const oldTab = this.tabs[index]; tab.meta.affixTab = true; + tab.meta.title = oldTab?.meta?.title as string; // this.addTab(tab); this.tabs.splice(index, 1, tab); } @@ -411,7 +413,9 @@ export const useTabbarStore = defineStore('core-tabbar', { ); if (index !== -1) { + const oldTab = this.tabs[index]; tab.meta.affixTab = false; + tab.meta.title = oldTab?.meta?.title as string; // this.addTab(tab); this.tabs.splice(index, 1, tab); }