main.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import Vue from 'vue'
  2. import 'normalize.css/normalize.css' // A modern alternative to CSS resets
  3. import '@/common/font/font.css'
  4. import ElementUI from 'element-ui'
  5. import 'element-ui/lib/theme-chalk/index.css'
  6. import locale from 'element-ui/lib/locale/lang/en' // lang i18n
  7. import elementUtils from 'vue-element-utils'
  8. import '@/styles/index.scss' // global css
  9. import BookUI from 'book-ui';
  10. import 'book-ui/dist/book-ui.css';
  11. Vue.use(BookUI);
  12. import App from './App'
  13. import store from './store'
  14. import router from './router'
  15. import '@/permission' // permission control
  16. // import '@/rem.js'
  17. // 拖拽插件
  18. import VueDND from 'awe-dnd'
  19. Vue.use(VueDND)
  20. // 连线
  21. import jsPlumb from 'jsplumb'
  22. Vue.prototype.$jsPlumb = jsPlumb.jsPlumb
  23. import vcolorpicker from 'vcolorpicker'
  24. Vue.use(vcolorpicker)
  25. import i18n from '@/utils/i18n';
  26. import EepUi from 'eep-ui'
  27. import 'eep-ui/style.css'
  28. // eepUI包
  29. Vue.use(EepUi);
  30. /**
  31. * If you don't want to use mock-server
  32. * you want to use MockJs for mock api
  33. * you can execute: mockXHR()
  34. *
  35. * Currently MockJs will be used in the production environment,
  36. * please remove it before going online ! ! !
  37. */
  38. // set ElementUI lang to EN
  39. // Vue.use(ElementUI, { locale })
  40. // 如果想要中文版 element-ui,按如下方式声明
  41. // element 下拉框下拉加载
  42. Vue.directive('loadmore', {
  43. bind(el, binding) {
  44. // 获取element-ui定义好的scroll盒子
  45. const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
  46. SELECTWRAP_DOM.addEventListener('scroll', function () {
  47. const CONDITION = this.scrollHeight - this.scrollTop <= this.clientHeight
  48. if (CONDITION) {
  49. binding.value()
  50. }
  51. })
  52. }
  53. })
  54. Vue.use(ElementUI)
  55. // v-select-scroll: Select 组件监听滚动,以便做懒加载
  56. Vue.use(elementUtils)
  57. Vue.config.productionTip = false
  58. new Vue({
  59. el: '#app',
  60. router,
  61. store,
  62. i18n,
  63. render: h => h(App)
  64. })