refactor(projects): 优化路由声明,添加路由模块导入,规范路相关文件夹

This commit is contained in:
Soybean
2021-11-21 18:44:18 +08:00
parent 2fdb5f563f
commit f199794da0
25 changed files with 444 additions and 200 deletions

View File

@@ -1,8 +1,7 @@
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
import type { App } from 'vue';
import { getCacheRoutes, transformRouteToMenu } from '@/utils';
import { routes, customRoutes } from '../routes';
import { createRouterGuide } from '../guide';
import { routes } from '../routes';
import { createRouterGuide } from '../guard';
/** 用于部署vercel托管服务 */
const isStaging = import.meta.env.VITE_HTTP_ENV === 'STAGING';
@@ -18,8 +17,5 @@ export async function setupRouter(app: App) {
await router.isReady();
}
/** 缓存的路由对应vue页面的名称 */
export const cacheRoutes = getCacheRoutes(routes);
/** 菜单 */
export const menus = transformRouteToMenu(customRoutes);
export { default as cacheRoutes } from './cache';
export { default as menus } from './menus';