Browse Source

Add spin for dynamic import

pull/174/head
afc163 9 years ago
parent
commit
9a584109ce
  1. 5
      src/index.less
  2. 7
      src/router.js

5
src/index.less

@ -7,3 +7,8 @@ body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.globalSpin {
width: 100%;
margin: 40px 0 !important;
}

7
src/router.js

@ -1,8 +1,13 @@
import React from 'react';
import { Router, Route, Switch } from 'dva/router';
import { LocaleProvider } from 'antd';
import { LocaleProvider, Spin } from 'antd';
import zhCN from 'antd/lib/locale-provider/zh_CN';
import dynamic from 'dva/dynamic';
import styles from './index.less';
dynamic.setDefaultLoadingComponent(() => {
return <Spin size="large" className={styles.globalSpin} />;
});
function RouterConfig({ history, app }) {
const BasicLayout = dynamic({

Loading…
Cancel
Save