main.js 1007 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import Vue from 'vue'
  2. import commonMethods from '@/common/commonMethods.js'
  3. import commonData from '@/common/commonData.js'
  4. import App from './App'
  5. import store from './store/index.js'
  6. import floatTab from '@/components/float-tab.vue'
  7. import cuCustom from './components/cu-custom.vue'
  8. import pageLoading from './components/page-loading.vue'
  9. import mpTabbar from './components/mp-tabbar.vue'
  10. import mixin from '@/common/utils/mixin.js'
  11. Vue.mixin(mixin)
  12. Vue.component('cu-custom', cuCustom)
  13. Vue.component('page-loading', pageLoading)
  14. Vue.component('mp-tabbar', mpTabbar)
  15. Vue.component('float-tab', floatTab)
  16. // 公共方法挂载在vue原型上
  17. for (const key in commonMethods) {
  18. Vue.prototype[key] = commonMethods[key]
  19. }
  20. // 公共方法挂载在vue原型上
  21. for (const key in commonData) {
  22. Vue.prototype[key] = commonData[key]
  23. }
  24. Vue.config.productionTip = false
  25. // 需要全局注册一下store
  26. Vue.prototype.$store = store
  27. App.mpType = 'app'
  28. const app = new Vue({
  29. store,
  30. ...App
  31. })
  32. app.$mount()