main.js 1.3 KB

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