Browse Source

Add loading component for dynamicImport

pull/2097/head
afc163 8 years ago
parent
commit
88b85407e9
  1. 4
      config/config.js
  2. 10
      src/components/PageLoading/index.js

4
config/config.js

@ -19,7 +19,9 @@ export default {
default: 'zh-CN', // default zh-CN
baseNavigator: true, // default true, when it is true, will use `navigator.language` overwrite default
},
dynamicImport: true,
dynamicImport: {
loadingComponent: './components/PageLoading/index',
},
polyfills: ['ie11'],
...(!process.env.TEST && os.platform() === 'darwin'
? {

10
src/components/PageLoading/index.js

@ -0,0 +1,10 @@
import React from 'react';
import { Spin } from 'antd';
// loading components from code split
// https://umijs.org/plugin/umi-plugin-react.html#dynamicimport
export default () => (
<div style={{ paddingTop: 100, textAlign: 'center' }}>
<Spin size="large" />
</div>
);
Loading…
Cancel
Save