main.js 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. import Vue from 'vue'
  2. import App from './App.vue'
  3. import { Loading } from 'element-ui';
  4. import router from './router' //路由
  5. import store from './config/config.js' //vuex
  6. import './plugins/element.js' //elementUI
  7. import './assets/sc/iconfont.css'
  8. import '@/permission' // permission control
  9. import VideoPlayer from 'vue-video-player'
  10. import 'video.js/dist/video-js.css' //videoJs的样式
  11. import 'vue-video-player/src/custom-theme.css' //vue-video-player的样式
  12. import ajax from './api/userApi' //封装axios
  13. Vue.prototype.ajax = ajax
  14. // Vue.prototype.$bus = {};
  15. Vue.use(VideoPlayer)
  16. Vue.config.productionTip = false
  17. Vue.prototype.$loading = Loading
  18. Vue.prototype.openLoading = function(target) {
  19. const loading = this.$loading.service({ // 声明一个loading对象
  20. lock: true, // 是否锁屏
  21. background: 'rgba(255, 255, 255, 0.7)', // 背景颜色
  22. target: target ? target : document.body, // 需要遮罩的区域
  23. body: true,
  24. })
  25. return loading;
  26. }
  27. new Vue({
  28. router,
  29. store,
  30. render: h => h(App)
  31. }).$mount('#app')