vue、react路由大气写法

版权声明:毒牙工作室 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$/))
        }
    ]
}

很灵性的路由写法。

猜你喜欢

转载自blog.csdn.net/qq_35023116/article/details/83820950