app.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import Vue from 'vue'
  2. import i18n from '@/locale';
  3. import router from './router/index'
  4. import store from './store'
  5. import { sync } from 'vuex-router-sync'
  6. import App from 'components/app-root'
  7. import { FontAwesomeIcon } from './icons'
  8. import iView from 'iview';
  9. import 'iview/dist/styles/iview.css';
  10. import commons from "@/utils/public.js";
  11. import apiTools from '@/api/api.js';
  12. import { fetch, post } from '@/filters/http.js';
  13. import VideoPlayer from 'vue-video-player';
  14. //import jwtDecode from 'jwt-decode';
  15. import animate from 'animate.css'
  16. require('video.js/dist/video-js.css');
  17. require('vue-video-player/src/custom-theme.css');
  18. Vue.use(VideoPlayer);
  19. //新添加的
  20. import vuescroll from 'vue-scroll'
  21. import echarts from 'echarts'
  22. //全局API请求
  23. Vue.prototype.$api = apiTools;
  24. Vue.prototype.$post = post;
  25. Vue.prototype.$get = fetch;
  26. //Vue.prototype.$jwtDecode = jwtDecode;
  27. Vue.use(vuescroll)
  28. Vue.use(animate)
  29. Vue.prototype.$echarts = echarts
  30. //ZXJ
  31. Vue.prototype.common = commons;
  32. // Registration of global components
  33. Vue.component('icon', FontAwesomeIcon);
  34. Vue.use(iView, {
  35. i18n: (key, value) => i18n.t(key, value)
  36. })
  37. sync(store, router)
  38. const app = new Vue({
  39. store,
  40. router,
  41. i18n,
  42. ...App
  43. })
  44. export {
  45. app,
  46. router,
  47. store
  48. }