index.js 622 Bytes
Newer Older
yoyo837's avatar
yoyo837 committed
1
import './polyfill';
2
import dva from 'dva';
jim's avatar
jim committed
3

Andreas Cederström's avatar
Andreas Cederström committed
4
import createHistory from 'history/createHashHistory';
jim's avatar
jim committed
5 6
// user BrowserHistory
// import createHistory from 'history/createBrowserHistory';
Andreas Cederström's avatar
Andreas Cederström committed
7
import createLoading from 'dva-loading';
8
import 'moment/locale/zh-cn';
偏右's avatar
偏右 committed
9
import './rollbar';
Andreas Cederström's avatar
Andreas Cederström committed
10

11 12 13
import './index.less';
// 1. Initialize
const app = dva({
Andreas Cederström's avatar
Andreas Cederström committed
14
  history: createHistory(),
15 16 17
});

// 2. Plugins
Andreas Cederström's avatar
Andreas Cederström committed
18
app.use(createLoading());
19

WhatAKitty's avatar
WhatAKitty committed
20
// 3. Register global model
21
app.model(require('./models/global').default);
22 23

// 4. Router
24
app.router(require('./router').default);
25 26 27

// 5. Start
app.start('#root');
28

jim's avatar
jim committed
29
export default app._store; // eslint-disable-line