mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-13 19:22:48 +00:00
17 lines
403 B
TypeScript
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
|
|
}
|