Skip to content

Commit

Permalink
Add spin for dynamic import
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Nov 14, 2017
1 parent 0d9b229 commit 9a58410
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.globalSpin {
width: 100%;
margin: 40px 0 !important;
}
7 changes: 6 additions & 1 deletion src/router.js
Original file line number Diff line number Diff line change
@@ -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({
Expand Down

0 comments on commit 9a58410

Please sign in to comment.