main.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import Vue from 'vue'
  2. import App from './App.vue'
  3. import router from './router'
  4. import store from './store'
  5. import 'whatwg-fetch' // fetch ie 11
  6. import vuetify from './plugins/vuetify'
  7. import '@/plugins/snackbar'
  8. import '@/plugins/confirm'
  9. import 'core-js/stable'
  10. import 'regenerator-runtime/runtime'
  11. import './permission' // 路由守卫
  12. import * as echarts from 'echarts'
  13. import i18n from './plugins/i18n/lang'
  14. import addToHome from './components/AddToHome'
  15. import UnifyExport from './components/UnifyExport'
  16. import promise from 'es6-promise'
  17. // 引入公用scss
  18. import '@/styles/index.scss'
  19. // 引入自定义指令
  20. import Directives from './directives/index.js'
  21. import 'scrolling-element'
  22. // import '@babel/polyfill'
  23. require('@babel/polyfill')
  24. promise.polyfill()
  25. Vue.use(Directives)
  26. Vue.component('AddToHome', addToHome)
  27. Vue.component('UnifyExport', UnifyExport)
  28. Vue.config.productionTip = false
  29. Vue.prototype.$echarts = echarts
  30. Vue.prototype.$eventBus = new Vue()
  31. Vue.prototype.$api = window?.g?.VUE_APP_BASE_API ?? process.env.VUE_APP_BASE_API
  32. Vue.prototype.$previewApi = window?.g?.VUE_APP_PREVIEW_URL ?? process.env.VUE_APP_PREVIEW_URL
  33. // 默认的标题
  34. Vue.prototype.$DEFAULT_TITLE = '数据运营平台'
  35. if (process.env.NODE_ENV === 'production') {
  36. // 重写 console.log, console.warn, console.error 等方法
  37. console.log = () => {}
  38. console.warn = () => {}
  39. console.error = () => {}
  40. }
  41. new Vue({
  42. router,
  43. store,
  44. vuetify,
  45. i18n,
  46. render: h => h(App)
  47. }).$mount('#app')