main.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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' // lang i18n
  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. import '@/customComponent.js'
  13. import '@/customInstructions.js'
  14. import VueClipboard from 'vue-clipboard2'
  15. Vue.use(VueClipboard)
  16. import md5 from 'js-md5'
  17. Vue.prototype.$md5 = md5
  18. /**
  19. * If you don't want to use mock-server
  20. * you want to use MockJs for mock api
  21. * you can execute: mockXHR()
  22. *
  23. * Currently MockJs will be used in the production environment,
  24. * please remove it before going online ! ! !
  25. */
  26. // if (process.env.NODE_ENV === 'production') {
  27. // const { mockXHR } = require('../mock')
  28. // mockXHR()
  29. // }
  30. // set ElementUI lang to EN
  31. Vue.use(ElementUI, { locale, size: 'small' })
  32. // 如果想要中文版 element-ui,按如下方式声明
  33. // Vue.use(ElementUI)
  34. Vue.config.productionTip = false
  35. new Vue({
  36. el: '#app',
  37. router,
  38. store,
  39. render: h => h(App)
  40. })
  41. window.$bus = new Vue()