main.js 1.3 KB

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