智慧教务系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
599 B

import type { RouterConfig } from '@nuxt/schema'
import routes from '@/app/pages/routes'
const addonRoutes = import.meta.globEager('@/addon/**/pages/routes.ts')
for (const key in addonRoutes) {
const addon = key.split('/')[2]
// 先加载插件路由后加载app路由
routes.unshift(...addonRoutes[key].default.map((item) => {
item.meta = item.meta ? Object.assign(item.meta, { addon }) : { addon }
return item
}))
}
// https://router.vuejs.org/api/interfaces/routeroptions.html
export default <RouterConfig>{
routes: (_routes) => routes,
strict: false
}