main.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 App from './App'
  10. import store from './store'
  11. import router from './router'
  12. import '@/permission' // permission control
  13. // import '@/rem.js'
  14. // 拖拽插件
  15. import VueDND from 'awe-dnd'
  16. Vue.use(VueDND)
  17. // 连线
  18. import jsPlumb from 'jsplumb'
  19. Vue.prototype.$jsPlumb = jsPlumb.jsPlumb
  20. import VideoPlayer from 'vue-video-player'
  21. require('video.js/dist/video-js.css')
  22. require('vue-video-player/src/custom-theme.css')
  23. Vue.use(VideoPlayer)
  24. /**
  25. * If you don't want to use mock-server
  26. * you want to use MockJs for mock api
  27. * you can execute: mockXHR()
  28. *
  29. * Currently MockJs will be used in the production environment,
  30. * please remove it before going online ! ! !
  31. */
  32. // set ElementUI lang to EN
  33. // Vue.use(ElementUI, { locale })
  34. // 如果想要中文版 element-ui,按如下方式声明
  35. // element 下拉框下拉加载
  36. Vue.directive('loadmore', {
  37. bind(el, binding) {
  38. // 获取element-ui定义好的scroll盒子
  39. const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
  40. SELECTWRAP_DOM.addEventListener('scroll', function () {
  41. const CONDITION = this.scrollHeight - this.scrollTop <= this.clientHeight
  42. if (CONDITION) {
  43. binding.value()
  44. }
  45. })
  46. }
  47. })
  48. Vue.use(ElementUI)
  49. // v-select-scroll: Select 组件监听滚动,以便做懒加载
  50. Vue.use(elementUtils)
  51. Vue.config.productionTip = false
  52. new Vue({
  53. el: '#app',
  54. router,
  55. store,
  56. render: h => h(App)
  57. })