index.js 601 B

12345678910111213141516171819202122232425262728
  1. import '@babel/polyfill';
  2. import dva from 'dva';
  3. import createHistory from 'history/createHashHistory';
  4. import createLoading from 'dva-loading';
  5. import 'moment/locale/zh-cn';
  6. import FastClick from 'fastclick';
  7. import './rollbar';
  8. import onError from './error';
  9. import './index.less';
  10. // 1. Initialize
  11. const app = dva({
  12. history: createHistory(),
  13. onError,
  14. });
  15. // 2. Plugins
  16. app.use(createLoading());
  17. // 3. Register global model
  18. app.model(require('./models/global').default);
  19. // 4. Router
  20. app.router(require('./router').default);
  21. // 5. Start
  22. app.start('#root');
  23. FastClick.attach(document.body);