main.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. /**
  24. * If you don't want to use mock-server
  25. * you want to use MockJs for mock api
  26. * you can execute: mockXHR()
  27. *
  28. * Currently MockJs will be used in the production environment,
  29. * please remove it before going online ! ! !
  30. */
  31. if (process.env.NODE_ENV === 'production') {
  32. const { mockXHR } = require('../mock')
  33. mockXHR()
  34. }
  35. // set ElementUI lang to EN
  36. // Vue.use(ElementUI, { locale })
  37. // 如果想要中文版 element-ui,按如下方式声明
  38. Vue.use(ElementUI)
  39. // register global utility filters
  40. Object.keys(filters).forEach(key => {
  41. Vue.filter(key, filters[key])
  42. })
  43. Vue.config.productionTip = false
  44. new Vue({
  45. el: '#app',
  46. router,
  47. store,
  48. render: h => h(App)
  49. })