perf: Improve the use of store in the app

This commit is contained in:
vince
2024-07-05 23:15:46 +08:00
parent ad6ae1d21d
commit 8042e2b044
39 changed files with 387 additions and 224 deletions

View File

@@ -3,6 +3,8 @@ import type { RouteRecordRaw } from 'vue-router';
import type { GeneratorMenuAndRoutesOptions } from '../types';
import { cloneDepp } from '@vben-core/toolkit';
import { generateMenus } from './generate-menus';
import { generateRoutesByBackend } from './generate-routes-backend';
import { generateRoutesByFrontend } from './generate-routes-frontend';
@@ -12,6 +14,8 @@ async function generateMenusAndRoutes(
options: GeneratorMenuAndRoutesOptions,
) {
const { router } = options;
options.routes = cloneDepp(options.routes);
// 生成路由
const accessibleRoutes = await generateRoutes(mode, options);