index.js 721 Bytes
Newer Older
1
import '@babel/polyfill';
2
import 'url-polyfill';
3
import dva from 'dva';
jim's avatar
jim committed
4

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

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

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

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

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

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


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

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