refactor: dynamic routes

This commit is contained in:
张传龙
2022-09-18 15:10:22 +08:00
parent 30211e14ea
commit bdbe9b8483
5 changed files with 50 additions and 38 deletions

View File

@@ -63,6 +63,12 @@ export const NOT_FOUND_ROUTE = {
isHidden: true,
}
export const EMPTY_ROUTE = {
name: 'Empty',
path: '/:pathMatch(.*)*',
component: null,
}
const modules = import.meta.glob('@/views/**/route.js', { eager: true })
const asyncRoutes = []
Object.keys(modules).forEach((key) => {