Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: maximum call stack size #4674

Merged
merged 4 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/@core/base/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
"dependencies": {
"@ctrl/tinycolor": "catalog:",
"@tanstack/vue-store": "catalog:",
"@vue/reactivity": "catalog:",
"@vue/shared": "catalog:",
"clsx": "catalog:",
"defu": "catalog:",
Expand Down
1 change: 0 additions & 1 deletion packages/@core/base/shared/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export * from './inference';
export * from './letter';
export * from './merge';
export * from './nprogress';
export * from './reactivity';
export * from './state-handler';
export * from './to';
export * from './tree';
Expand Down
26 changes: 0 additions & 26 deletions packages/@core/base/shared/src/utils/reactivity.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { computed, ref } from 'vue';

import { Pin, X } from '@vben-core/icons';
import { VbenContextMenu, VbenIcon } from '@vben-core/shadcn-ui';
import { deepToRaw } from '@vben-core/shared/utils';

interface Props extends TabsProps {}

Expand Down Expand Up @@ -41,16 +40,15 @@ const style = computed(() => {
});

const tabsView = computed((): TabConfig[] => {
return props.tabs.map((_tab) => {
const tab = deepToRaw(_tab);
return props.tabs.map((tab) => {
return {
...tab,
affixTab: !!tab.meta?.affixTab,
closable: Reflect.has(tab.meta, 'tabClosable')
? !!tab.meta.tabClosable
: true,
icon: tab.meta.icon as string,
key: tab.fullPath || tab.path,
name: tab.name,
title: (tab.meta?.newTabTitle || tab.meta?.title || tab.name) as string,
};
});
Expand Down
10 changes: 4 additions & 6 deletions packages/@core/ui-kit/tabs-ui/src/components/tabs/tabs.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<script lang="ts" setup>
import type { TabDefinition } from '@vben-core/typings';

import type { TabConfig, TabsProps } from '../../types';
import type { TabsProps } from '../../types';
vince292007 marked this conversation as resolved.
Show resolved Hide resolved

import { computed } from 'vue';

import { Pin, X } from '@vben-core/icons';
import { VbenContextMenu, VbenIcon } from '@vben-core/shadcn-ui';
import { deepToRaw } from '@vben-core/shared/utils';

interface Props extends TabsProps {}

Expand Down Expand Up @@ -46,17 +45,16 @@ const typeWithClass = computed(() => {
return typeClasses[props.styleType || 'plain'] || { content: '' };
});

const tabsView = computed((): TabConfig[] => {
return props.tabs.map((_tab) => {
const tab = deepToRaw(_tab);
const tabsView = computed(() => {
return props.tabs.map((tab) => {
return {
...tab,
affixTab: !!tab.meta?.affixTab,
closable: Reflect.has(tab.meta, 'tabClosable')
? !!tab.meta.tabClosable
: true,
icon: tab.meta.icon as string,
key: tab.fullPath || tab.path,
name: tab.name,
title: (tab.meta?.newTabTitle || tab.meta?.title || tab.name) as string,
};
});
Expand Down
4 changes: 2 additions & 2 deletions packages/effects/layouts/src/basic/layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
usePreferences,
} from '@vben/preferences';
import { useLockStore } from '@vben/stores';
import { deepToRaw, mapTree } from '@vben/utils';
import { cloneDeep, mapTree } from '@vben/utils';
import { VbenAdminLayout } from '@vben-core/layout-ui';
import { VbenBackTop, VbenLogo } from '@vben-core/shadcn-ui';

Expand Down Expand Up @@ -112,7 +112,7 @@ const {

function wrapperMenus(menus: MenuRecordRaw[]) {
return mapTree(menus, (item) => {
return { ...deepToRaw(item), name: $t(item.name) };
return { ...cloneDeep(item), name: $t(item.name) };
});
}

Expand Down
Loading
Loading