From 40dcc4a10814401c268afdaf4d4c1a1b99c52c5d Mon Sep 17 00:00:00 2001 From: fengyon Date: Fri, 19 Apr 2024 15:44:43 -0700 Subject: [PATCH] fix(toolkit/pro): fix the error: Maximum call stack size exceeded fix #128 --- .../toolkits/pro/template/tinyvue/src/router/routes/index.ts | 2 +- .../pro/template/tinyvue/src/store/modules/app/index.ts | 2 +- .../pro/template/tinyvue/src/store/modules/user/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/toolkits/pro/template/tinyvue/src/router/routes/index.ts b/packages/toolkits/pro/template/tinyvue/src/router/routes/index.ts index aa3c8ac8..ee0ca2cc 100644 --- a/packages/toolkits/pro/template/tinyvue/src/router/routes/index.ts +++ b/packages/toolkits/pro/template/tinyvue/src/router/routes/index.ts @@ -1,6 +1,6 @@ import type { RouteRecordRaw } from 'vue-router'; -const modules = import.meta.globEager('./modules/*.ts'); +const modules = import.meta.glob('./modules/*.ts', { eager: true }); const appRoutes: RouteRecordRaw[] = []; Object.keys(modules).forEach((key) => { diff --git a/packages/toolkits/pro/template/tinyvue/src/store/modules/app/index.ts b/packages/toolkits/pro/template/tinyvue/src/store/modules/app/index.ts index d1d3c0c2..7bb6bc7b 100644 --- a/packages/toolkits/pro/template/tinyvue/src/store/modules/app/index.ts +++ b/packages/toolkits/pro/template/tinyvue/src/store/modules/app/index.ts @@ -7,7 +7,7 @@ const useAppStore = defineStore('app', { getters: { appCurrentSetting(state: AppState): AppState { - return { ...state }; + return state; }, appDevice(state: AppState) { return state.device; diff --git a/packages/toolkits/pro/template/tinyvue/src/store/modules/user/index.ts b/packages/toolkits/pro/template/tinyvue/src/store/modules/user/index.ts index 998dedaf..09992554 100644 --- a/packages/toolkits/pro/template/tinyvue/src/store/modules/user/index.ts +++ b/packages/toolkits/pro/template/tinyvue/src/store/modules/user/index.ts @@ -37,7 +37,7 @@ const useUserStore = defineStore('user', { getters: { userInfo(state: UserState): UserState { - return { ...state }; + return state; }, },