main.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import Vue from 'vue';
  2. import 'normalize.css/normalize.css'; // A modern alternative to CSS resets
  3. import ElementUI from 'element-ui';
  4. import 'element-ui/lib/theme-chalk/index.css';
  5. import locale from 'element-ui/lib/locale/lang/zh-CN';
  6. import '@/styles/index.scss'; // global css
  7. import '@/styles/custom.scss'; // global css
  8. import App from './App';
  9. import store from './store';
  10. import router from './router';
  11. import '@/icons'; // icon
  12. import '@/permission'; // permission control
  13. // baseUrl = '/api
  14. import axios from '@/axios/index';
  15. // baseUrl = '/bazb
  16. import axios2 from '@/axios/index2';
  17. // baseUrl = '/bass
  18. import axios3 from '@/axios/index3';
  19. import '@/mixins';
  20. /**
  21. * If you don't want to use mock-server
  22. * you want to use MockJs for mock api
  23. * you can execute: mockXHR()
  24. *
  25. * Currently MockJs will be used in the production environment,
  26. * please remove it before going online ! ! !
  27. */
  28. if (process.env.NODE_ENV === 'production') {
  29. const { mockXHR } = require('../mock');
  30. mockXHR();
  31. }
  32. Vue.prototype.$axios = axios;
  33. Vue.prototype.$axios2 = axios2;
  34. Vue.prototype.$axios3 = axios3;
  35. // set ElementUI lang to EN
  36. Vue.use(ElementUI, { locale });
  37. // 如果想要中文版 element-ui,按如下方式声明
  38. // Vue.use(ElementUI)
  39. Vue.config.productionTip = false;
  40. new Vue({
  41. el: '#app',
  42. router,
  43. store,
  44. render: h => h(App),
  45. });