main.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 elementUtils from 'vue-element-utils'
  7. import '@/styles/index.scss' // global css
  8. import App from './App'
  9. import store from './store'
  10. import router from './router'
  11. import '@/permission' // permission control
  12. import i18n from '@/utils/i18n';
  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. /**
  21. * If you don't want to use mock-server
  22. * you want to use MockJs for mock api
  23. * you can execute: mockXHR()
  24. *
  25. * Currently MockJs will be used in the production environment,
  26. * please remove it before going online ! ! !
  27. */
  28. // set ElementUI lang to EN
  29. // Vue.use(ElementUI, { locale })
  30. // 如果想要中文版 element-ui,按如下方式声明
  31. // element 下拉框下拉加载
  32. Vue.directive('loadmore', {
  33. bind(el, binding) {
  34. // 获取element-ui定义好的scroll盒子
  35. const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
  36. SELECTWRAP_DOM.addEventListener('scroll', function() {
  37. const CONDITION = this.scrollHeight - this.scrollTop <= this.clientHeight
  38. if (CONDITION) {
  39. binding.value()
  40. }
  41. })
  42. }
  43. })
  44. Vue.use(ElementUI)
  45. // v-select-scroll: Select 组件监听滚动,以便做懒加载
  46. Vue.use(elementUtils)
  47. Vue.config.productionTip = false
  48. new Vue({
  49. el: '#app',
  50. router,
  51. store,
  52. i18n,
  53. data: function() {
  54. return {
  55. isRecording: false
  56. }
  57. },
  58. render: h => h(App)
  59. })