From 11551903f09a30631fc9ffde430e27e52b884545 Mon Sep 17 00:00:00 2001 From: Zhang Zhi Chao <54631354+Alkaidcc@users.noreply.github.com> Date: Thu, 15 Aug 2024 21:47:54 +0800 Subject: [PATCH] fix: newTabTitle does not work as expected (#4160) * fix: cloneDeep tab close #4158 * Revert "fix: cloneDeep tab close #4158" This reverts commit 8e2f4b39ad7442768bac964c6a113e5084b320a7. * fix: deep clone meta.newTabTitle --- packages/stores/src/modules/tabbar.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/stores/src/modules/tabbar.ts b/packages/stores/src/modules/tabbar.ts index a3738103..cea958a9 100644 --- a/packages/stores/src/modules/tabbar.ts +++ b/packages/stores/src/modules/tabbar.ts @@ -478,7 +478,7 @@ function cloneTab(route: TabDefinition): TabDefinition { if (!route) { return route; } - const { matched, ...opt } = route; + const { matched, meta, ...opt } = route; return { ...opt, matched: (matched @@ -488,6 +488,10 @@ function cloneTab(route: TabDefinition): TabDefinition { path: item.path, })) : undefined) as RouteRecordNormalized[], + meta: { + ...meta, + newTabTitle: meta.newTabTitle, + }, }; }