main.js 1017 B

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