refactor(projects): 精简版+动态路由权限初步

This commit is contained in:
Soybean
2022-01-03 22:20:10 +08:00
parent 7a0648dba5
commit de2057f141
354 changed files with 2053 additions and 22117 deletions

View File

@@ -1,3 +1,18 @@
export * from './constant';
export * from './routes';
export * from './setup';
import type { App } from 'vue';
import { createRouter, createWebHistory } from 'vue-router';
import { routes, constantRoutes } from './routes';
import { createRouterGuide } from './guard';
export const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes,
scrollBehavior: () => ({ left: 0, top: 0 })
});
export async function setupRouter(app: App) {
app.use(router);
createRouterGuide(router);
await router.isReady();
}
export { constantRoutes };