版权声明:毒牙工作室 https://blog.csdn.net/qq_35023116/article/details/83820950
const rootRoute = {
childRoutes: [
{
path: '/',
component: AppLayout,
childRoutes: (r => {
return r.keys().map(key => r(key));
})(require.context('./', true, /^\.\/modules\/((?!\/)[\s\S])+\/route\.js$/))
}
]
}
很灵性的路由写法。