main.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 '@/styles/index.scss' // global css
  6. import App from './App'
  7. import store from './store'
  8. import router from './router'
  9. import '@/icons' // icon
  10. import '@/permission' // permission control
  11. import '@/config/checkPermission' //按钮权限 全局自定义指令v-is
  12. // import lodash
  13. import _ from 'lodash'
  14. Vue.prototype._ = _
  15. // import echarts
  16. import * as echarts from 'echarts'
  17. import Vue2OrgTree from 'vue2-org-tree'
  18. import 'vue2-org-tree/dist/style.css'
  19. Vue.use(Vue2OrgTree)
  20. Vue.use(ElementUI)
  21. Vue.directive('loadmore', {
  22. bind(el, binding) {
  23. if (!binding.value) {
  24. return
  25. }
  26. const selectWrap = el.querySelector('.el-table__body-wrapper')
  27. selectWrap.addEventListener('scroll', function () {
  28. const sign = 0
  29. const scrollDistance = this.scrollHeight - this.scrollTop - this.clientHeight
  30. if (scrollDistance <= sign) {
  31. binding.value()
  32. }
  33. })
  34. }
  35. })
  36. Vue.prototype.$echarts = echarts
  37. Vue.config.productionTip = false
  38. new Vue({
  39. router,
  40. store,
  41. render: (h) => h(App)
  42. }).$mount('#app')