Commit 9a584109 authored by afc163's avatar afc163

Add spin for dynamic import

parent 0d9b229c
...@@ -7,3 +7,8 @@ body { ...@@ -7,3 +7,8 @@ body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.globalSpin {
width: 100%;
margin: 40px 0 !important;
}
import React from 'react'; import React from 'react';
import { Router, Route, Switch } from 'dva/router'; 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 zhCN from 'antd/lib/locale-provider/zh_CN';
import dynamic from 'dva/dynamic'; import dynamic from 'dva/dynamic';
import styles from './index.less';
dynamic.setDefaultLoadingComponent(() => {
return <Spin size="large" className={styles.globalSpin} />;
});
function RouterConfig({ history, app }) { function RouterConfig({ history, app }) {
const BasicLayout = dynamic({ const BasicLayout = dynamic({
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment