From 8457cb26566a025838bfdd69010c479308dce13e Mon Sep 17 00:00:00 2001 From: pine-storm <280722781@qq.com> Date: Tue, 15 Oct 2024 18:28:52 +0800 Subject: [PATCH] fix: internationalization issue of tabView title Fix the problem that the tabView title is not switched when internationalization is switched due to the pin and unpin of tabView. --- packages/stores/src/modules/tabbar.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/stores/src/modules/tabbar.ts b/packages/stores/src/modules/tabbar.ts index 80d8853cff9..9d18dbfa878 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; // this.addTab(tab); this.tabs.splice(index, 1, tab); } @@ -409,9 +411,10 @@ export const useTabbarStore = defineStore('core-tabbar', { const index = this.tabs.findIndex( (item) => getTabPath(item) === getTabPath(tab), ); - if (index !== -1) { + const oldTab = this.tabs[index]; tab.meta.affixTab = false; + tab.meta.title = oldTab?.meta?.title; // this.addTab(tab); this.tabs.splice(index, 1, tab); }