main.js 1010 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 SpriteIcon from '@/components/sprite-icon/index.vue'
  12. Vue.component('sprite-icon', SpriteIcon)
  13. //import tabBar from './components/item/app-tabbar.vue'
  14. //Vue.component('tab-bar', tabBar)
  15. import store from './store'
  16. Vue.prototype.$store = store
  17. // 阻止启动生产消息,常用作指令
  18. Vue.config.productionTip = false
  19. // 封装得全局消息提示
  20. Vue.prototype.$msg = (title) => (
  21. uni.showToast({
  22. title,
  23. icon: 'none'
  24. })
  25. )
  26. // 生产环境中控制台不打印普通信息,以免造成内存泄漏
  27. if (process.env.NODE_ENV == 'production') {
  28. if (console) {
  29. console.log = () => {}
  30. }
  31. }
  32. App.mpType = 'app'
  33. const app = new Vue({
  34. store,
  35. ...App
  36. })
  37. app.$mount()