index.js 601 Bytes
Newer Older
1
import '@babel/polyfill';
2
import dva from 'dva';
Andreas Cederström's avatar
Andreas Cederström committed
3 4
import createHistory from 'history/createHashHistory';
import createLoading from 'dva-loading';
5
import 'moment/locale/zh-cn';
afc163's avatar
afc163 committed
6
import FastClick from 'fastclick';
偏右's avatar
偏右 committed
7
import './rollbar';
陈帅's avatar
陈帅 committed
8
import onError from './error';
Andreas Cederström's avatar
Andreas Cederström committed
9

10 11 12
import './index.less';
// 1. Initialize
const app = dva({
Andreas Cederström's avatar
Andreas Cederström committed
13
  history: createHistory(),
陈帅's avatar
陈帅 committed
14
  onError,
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');
afc163's avatar
afc163 committed
28
FastClick.attach(document.body);