2021-08-17 14:59:59 +08:00
|
|
|
import { createRouter, createWebHistory } from 'vue-router';
|
|
|
|
import type { App } from 'vue';
|
|
|
|
import type { RouteRecordRaw } from 'vue-router';
|
|
|
|
import { customRoutes } from './routes';
|
|
|
|
import createRouterGuide from './permission';
|
|
|
|
|
|
|
|
const routes: Array<RouteRecordRaw> = [...customRoutes];
|
|
|
|
|
2021-08-18 12:02:59 +08:00
|
|
|
export const router = createRouter({
|
2021-08-17 14:59:59 +08:00
|
|
|
history: createWebHistory(),
|
|
|
|
routes
|
|
|
|
});
|
|
|
|
|
|
|
|
createRouterGuide(router);
|
|
|
|
|
|
|
|
export function setupRouter(app: App) {
|
|
|
|
app.use(router);
|
|
|
|
}
|