动态菜单和动态路由的 antd pro

index.js 650B

12345678910111213141516171819202122232425262728293031
  1. import '@babel/polyfill';
  2. import 'url-polyfill';
  3. import dva from 'dva';
  4. import createHistory from 'history/createHashHistory';
  5. // user BrowserHistory
  6. // import createHistory from 'history/createBrowserHistory';
  7. import createLoading from 'dva-loading';
  8. import 'moment/locale/zh-cn';
  9. import './rollbar';
  10. import './index.less';
  11. // 1. Initialize
  12. const app = dva({
  13. history: createHistory(),
  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. export default app._store; // eslint-disable-line