使用react dva按需加载

然后子路由组件会报错。

Add "publicPath": "/" to .webpackrc or .roadhogrc can fix this issue

export default function RouterConfig({ history,app }) {
    const LoginPage = (dynamic as any)({
        app,
        component:()=>import('./routes/LoginPage/LoginPage')
    })
    const HomePage = (dynamic as any)({
        app,
        component:()=>import('./routes/HomePage')
    })

 

posted @ 2019-01-27 23:07  星陨的菲  阅读(960)  评论(0编辑  收藏  举报