main.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. import './assets/icons/iconfont.css'
  14. // baseUrl = '/api
  15. import axios from '@/axios/index';
  16. // baseUrl = '/bazb
  17. import axios2 from '@/axios/index2';
  18. // baseUrl = '/bass
  19. import axios3 from '@/axios/index3';
  20. // baseUrl = '/yxbl
  21. import axios4 from '@/axios/index4';
  22. // baseUrl = '/
  23. import axios_new from '@/axios/index_new';
  24. import '@/mixins';
  25. import * as echarts from 'echarts'
  26. Vue.prototype.$echarts = echarts
  27. // 引入弹窗拖拽一方法
  28. import VueDragResize from 'vue-drag-resize'
  29. Vue.component('vue-drag-resize', VueDragResize)
  30. Vue.prototype.$getViewportSize = function() {
  31. return {
  32. width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
  33. height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
  34. }
  35. }
  36. // 注册全局指令
  37. import elDragDialog from './directive/el-drag-dialog'
  38. Vue.use(elDragDialog, { directiveName: 'el-drag-dialog' })
  39. // 全局组件
  40. import CardTitle from '@/components/CardTitle'
  41. Vue.component('CardTitle', CardTitle)
  42. /**
  43. * If you don't want to use mock-server
  44. * you want to use MockJs for mock api
  45. * you can execute: mockXHR()
  46. *
  47. * Currently MockJs will be used in the production environment,
  48. * please remove it before going online ! ! !
  49. */
  50. if (process.env.NODE_ENV === 'production') {
  51. const { mockXHR } = require('../mock');
  52. mockXHR();
  53. }
  54. Vue.prototype.$axios = axios;
  55. Vue.prototype.$axios2 = axios2;
  56. Vue.prototype.$axios3 = axios3;
  57. Vue.prototype.$axios4 = axios4;
  58. Vue.prototype.$axios_new = axios_new;
  59. // set ElementUI lang to EN
  60. Vue.use(ElementUI, { locale });
  61. // 如果想要中文版 element-ui,按如下方式声明
  62. // Vue.use(ElementUI)
  63. Vue.config.productionTip = false;
  64. new Vue({
  65. el: '#app',
  66. router,
  67. store,
  68. render: h => h(App),
  69. });