main.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 zh from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
  7. import directive from './directive'
  8. import auth from './plugins/auth'
  9. import '@/styles/index.scss' // global css
  10. import App from './App'
  11. import store from './store'
  12. import router from './router'
  13. import '@/icons' // icon
  14. import '@/permission' // permission control
  15. import {
  16. parseTime,
  17. resetForm,
  18. addDateRange,
  19. selectDictLabel,
  20. selectDictLabels,
  21. handleTree,
  22. getMonthDate
  23. } from "@/utils/common";
  24. Vue.prototype.parseTime = parseTime
  25. Vue.prototype.resetForm = resetForm
  26. Vue.prototype.addDateRange = addDateRange
  27. Vue.prototype.selectDictLabel = selectDictLabel
  28. Vue.prototype.selectDictLabels = selectDictLabels
  29. Vue.prototype.handleTree = handleTree
  30. Vue.prototype.getMonthDate = getMonthDate
  31. // set ElementUI lang to EN
  32. // Vue.use(ElementUI, { locale })
  33. // 如果想要中文版 element-ui,按如下方式声明
  34. Vue.use(ElementUI, {locale: zh})
  35. Vue.use(directive)
  36. Vue.use(auth)
  37. Vue.config.productionTip = false
  38. new Vue({
  39. el: '#app',
  40. router,
  41. store,
  42. render: h => h(App)
  43. })