Skip to content

Commit

Permalink
Merge pull request umijs#662 from umijs/fix/dva-loading-component
Browse files Browse the repository at this point in the history
fix(umi-plugin-dva): opts.loading don't work with umi-plugin-dva
  • Loading branch information
sorrycc authored Jun 26, 2018
2 parents 0c08f60 + d715e20 commit 747073c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/umi-plugin-dva/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,18 @@ ${ROUTER_MODIFIER}
return memo;
}

const { loading } = config;
let loadingOpts = '';
if (loading) {
loadingOpts = `LoadingComponent: require('${winPath(
join(paths.cwd, loading),
)}').default,`;
}
let ret = `
_dvaDynamic({
<%= MODELS %>
component: () => import(/* webpackChunkName: '${webpackChunkName}' */'${pageJSFile}'),
${loadingOpts}
})
`.trim();
const models = getPageModels(
Expand Down

0 comments on commit 747073c

Please sign in to comment.