main-web/src/router/index.ts

21 lines
493 B
TypeScript
Raw Normal View History

2024-08-20 12:11:33 +00:00
import { createRouter, createWebHistory } from 'vue-router'
import routes from './constant'
function createRoute() {
return createRouter({
history: createWebHistory(),
2024-08-21 01:17:14 +00:00
routes
2024-08-20 12:11:33 +00:00
})
}
const router = createRoute()
export const asyncRouterMap = {
Home: () => import('@/layouts/home.vue'),
2024-08-21 01:17:14 +00:00
App: () => import('@/layouts/app.vue')
2024-08-20 12:11:33 +00:00
}
export function resetRouter() {
// const newRouter = createRoute();
// router.matcher = newRouter.matcher; // reset router
}
export default router