main.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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/en' // lang i18n
  6. import * as echarts from 'echarts'
  7. Vue.prototype.$echarts = echarts
  8. import '@/styles/index.scss' // global css
  9. import App from './App'
  10. import store from './store'
  11. import router from './router'
  12. import '@/icons' // icon
  13. import '@/permission' // permission control
  14. import * as filters from './filters' // global filters
  15. // 成功/错误提示
  16. import {successMsg, errorMsg, warningNotify} from '@/utils/common.js'
  17. Vue.prototype.$successMsg = successMsg;
  18. Vue.prototype.$errorMsg = errorMsg;
  19. Vue.prototype.$warningNotify = warningNotify;
  20. // 自定义组件
  21. import ExportButton from '@/components/Common/export-button.vue'
  22. Vue.component('ExportButton', ExportButton);
  23. import ImportButton from '@/components/Common/import-button.vue'
  24. Vue.component('ImportButton', ImportButton);
  25. Vue.prototype.$imageUrl = process.env.VUE_APP_BASE_API + 'img/get?key=';
  26. /**
  27. * If you don't want to use mock-server
  28. * you want to use MockJs for mock api
  29. * you can execute: mockXHR()
  30. *
  31. * Currently MockJs will be used in the production environment,
  32. * please remove it before going online ! ! !
  33. */
  34. if (process.env.NODE_ENV === 'production') {
  35. const { mockXHR } = require('../mock')
  36. mockXHR()
  37. }
  38. // set ElementUI lang to EN
  39. // Vue.use(ElementUI, { locale })
  40. // 如果想要中文版 element-ui,按如下方式声明
  41. Vue.use(ElementUI)
  42. // register global utility filters
  43. Object.keys(filters).forEach(key => {
  44. Vue.filter(key, filters[key])
  45. })
  46. Vue.config.productionTip = false
  47. new Vue({
  48. el: '#app',
  49. router,
  50. store,
  51. render: h => h(App)
  52. })