main.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 promise from 'es6-promise'
  15. // 引入公用scss
  16. import '@/styles/index.scss'
  17. // 引入自定义指令
  18. import Directives from './directives/index.js'
  19. import 'scrolling-element'
  20. // import '@babel/polyfill'
  21. require('@babel/polyfill')
  22. promise.polyfill()
  23. Vue.use(Directives)
  24. Vue.config.productionTip = false
  25. Vue.prototype.$echarts = echarts
  26. Vue.prototype.$eventBus = new Vue()
  27. Vue.prototype.$api = window?.g?.VUE_APP_BASE_API ?? process.env.VUE_APP_BASE_API
  28. Vue.prototype.$previewApi = window?.g?.VUE_APP_PREVIEW_URL ?? process.env.VUE_APP_PREVIEW_URL
  29. // 默认的标题
  30. Vue.prototype.$DEFAULT_TITLE = '数据运营平台'
  31. if (process.env.NODE_ENV === 'production') {
  32. // 重写 console.log, console.warn, console.error 等方法
  33. console.log = () => {}
  34. console.warn = () => {}
  35. console.error = () => {}
  36. }
  37. new Vue({
  38. router,
  39. store,
  40. vuetify,
  41. i18n,
  42. render: h => h(App)
  43. }).$mount('#app')