main.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import Vue from 'vue'
  2. import App from './App'
  3. import constants from '@/constant/index'
  4. Vue.prototype.$constant = constants
  5. import './static/iconfont/iconfont.css'
  6. import '@/filters/index'
  7. import util from './utils/util'
  8. Vue.prototype.$util = util
  9. import globalMixins from './mixins/globalMixins'
  10. Vue.mixin(globalMixins)
  11. import tabBar from './components/app-tabbar.vue'
  12. Vue.component('tab-bar', tabBar)
  13. import store from './store'
  14. Vue.prototype.$store = store
  15. // 阻止启动生产消息,常用作指令
  16. Vue.config.productionTip = false
  17. // 封装得全局消息提示
  18. Vue.prototype.$msg = (title) => (
  19. uni.showToast({
  20. title,
  21. icon: 'none'
  22. })
  23. )
  24. // 生产环境中控制台不打印普通信息,以免造成内存泄漏
  25. if (process.env.NODE_ENV == 'production') {
  26. if (console) {
  27. console.log = () => {}
  28. }
  29. }
  30. // Vue.prototype.$backgroundAudioData = {
  31. // playing: false,
  32. // playTime: 0,
  33. // formatedPlayTime: '00:00:00'
  34. // }
  35. // Vue.component('page-head', pageHead)
  36. // Vue.component('page-foot', pageFoot)
  37. // Vue.component('uLink', uLink)
  38. App.mpType = 'app'
  39. const app = new Vue({
  40. store,
  41. ...App
  42. })
  43. app.$mount()