const Login = Loadable({
loader: () => import('./components/Login'),
loading: () => <div>loading...</div>
})
上面的很ok
下面的模块导出方式不一样
weather/index.js
import view from './views/weather.js'
export { view }
const Weather = Loadable({ loader: () => {
import { view as Weather } from './weather'
这里的Weather我怎么返回给loader,(不修改weather/index的前提下)由于是异步的,直接返回肯定不行
}, loading: () => <div>loading...</div> })
小怪兽爱吃肉
红颜莎娜
相关分类