index.js 698 Bytes
Newer Older
1
import '@babel/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';
afc163's avatar
afc163 committed
9
import FastClick from 'fastclick';
偏右's avatar
偏右 committed
10
import './rollbar';
Andreas Cederström's avatar
Andreas Cederström committed
11

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

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

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

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

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


afc163's avatar
afc163 committed
31
FastClick.attach(document.body);
32 33

export default app._store;  // eslint-disable-line