main.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 '@/assets/styles/ruoyi.scss'
  11. import App from './App'
  12. import store from './store'
  13. import router from './router'
  14. import '@/icons' // icon
  15. import '@/permission' // permission control
  16. import { getDictData } from "@/api/system/dict";
  17. // 字典标签组件
  18. import DictTag from '@/components/DictTag'
  19. // 字典数据组件
  20. import DictData from '@/components/DictData'
  21. import {
  22. parseTime,
  23. resetForm,
  24. addDateRange,
  25. selectDictLabel,
  26. selectDictLabels,
  27. handleTree,
  28. getMonthDate
  29. } from "@/utils/common";
  30. //时间转换主键
  31. import * as moment from 'moment'
  32. Vue.prototype.getDicts = getDictData
  33. Vue.prototype.$moment = moment
  34. Vue.prototype.parseTime = parseTime
  35. Vue.prototype.resetForm = resetForm
  36. Vue.prototype.addDateRange = addDateRange
  37. Vue.prototype.selectDictLabel = selectDictLabel
  38. Vue.prototype.selectDictLabels = selectDictLabels
  39. Vue.prototype.handleTree = handleTree
  40. Vue.prototype.getMonthDate = getMonthDate
  41. Vue.component('DictTag', DictTag)
  42. // set ElementUI lang to EN
  43. // Vue.use(ElementUI, { locale })
  44. // 如果想要中文版 element-ui,按如下方式声明
  45. Vue.use(ElementUI, {locale: zh})
  46. Vue.use(directive)
  47. Vue.use(auth)
  48. DictData.install()
  49. Vue.config.productionTip = false
  50. new Vue({
  51. el: '#app',
  52. router,
  53. store,
  54. render: h => h(App)
  55. })