niucloud-admin/web/app/router.options.ts
全栈小学生 94c19e2ee3 update web
2023-09-06 18:40:52 +08:00

17 lines
403 B
TypeScript

import type { RouterConfig } from '@nuxt/schema'
const routeFiles = import.meta.glob('../**/routes.ts')
const routes = []
for (const key of Object.keys(routeFiles)) {
await routeFiles[key]().then(res => {
routes.push(...res.default)
})
}
// https://router.vuejs.org/api/interfaces/routeroptions.html
export default <RouterConfig>{
routes: (_routes) => routes,
strict: false
}