fix: cloneDeep tab close #4158

This commit is contained in:
Alkaidcc 2024-08-15 16:02:43 +08:00
parent e2d9d08ced
commit 8e2f4b39ad
No known key found for this signature in database
3 changed files with 11 additions and 11 deletions

View File

@ -22,6 +22,7 @@
"dependencies": {
"@vben-core/shared": "workspace:*",
"@vben-core/typings": "workspace:*",
"es-toolkit": "^1.15.1",
"pinia": "2.2.1",
"pinia-plugin-persistedstate": "^3.2.1",
"vue": "^3.4.37",

View File

@ -5,6 +5,7 @@ import { toRaw } from 'vue';
import { openWindow, startProgress, stopProgress } from '@vben-core/shared';
import { cloneDeep } from 'es-toolkit';
import { acceptHMRUpdate, defineStore } from 'pinia';
interface TabbarState {
@ -478,17 +479,7 @@ function cloneTab(route: TabDefinition): TabDefinition {
if (!route) {
return route;
}
const { matched, ...opt } = route;
return {
...opt,
matched: (matched
? matched.map((item) => ({
meta: item.meta,
name: item.name,
path: item.path,
}))
: undefined) as RouteRecordNormalized[],
};
return cloneDeep(route);
}
/**

8
pnpm-lock.yaml generated
View File

@ -1037,6 +1037,9 @@ importers:
'@vben-core/typings':
specifier: workspace:*
version: link:../@core/base/typings
es-toolkit:
specifier: ^1.15.1
version: 1.15.1
pinia:
specifier: 2.2.1
version: 2.2.1(typescript@5.5.4)(vue@3.4.37(typescript@5.5.4))
@ -5500,6 +5503,9 @@ packages:
resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==}
engines: {node: '>= 0.4'}
es-toolkit@1.15.1:
resolution: {integrity: sha512-2rPCylgxxpgZ3jQLyvbm+B9dNAMdHv4S80iabK9njEWxDbObhAPJCQUpqHv8iaOZrfprl3UlWhfxZd7kKSQtbg==}
esbuild@0.19.12:
resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==}
engines: {node: '>=12'}
@ -14536,6 +14542,8 @@ snapshots:
is-date-object: 1.0.5
is-symbol: 1.0.4
es-toolkit@1.15.1: {}
esbuild@0.19.12:
optionalDependencies:
'@esbuild/aix-ppc64': 0.19.12