main.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. import App from './App'
  2. import Vue from 'vue'
  3. import store from './store'
  4. import FamilyEmptyState from './components/FamilyEmptyState/FamilyEmptyState.vue'
  5. import CustomTabBar from './custom-tab-bar/index.vue'
  6. import LoginSheet from './components/login-sheet.vue'
  7. import loginSheetMixin from './mixins/login-sheet.js'
  8. import { formatPriceWithSymbol, formatPrice, formatRate, formatScore } from '@/utils/format'
  9. Vue.config.productionTip = false
  10. Vue.component('FamilyEmptyState', FamilyEmptyState)
  11. Vue.component('custom-tab-bar', CustomTabBar)
  12. // 全局登录浮层:任意页面模板可直接使用 <login-sheet ref="loginSheet" @success="onSheetLoginSuccess" />,
  13. // 并借助全局 mixin 的 this.openLoginSheet() 弹出(未挂浮层的页面自动回退整页登录)
  14. Vue.component('login-sheet', LoginSheet)
  15. Vue.mixin(loginSheetMixin)
  16. Vue.prototype.$store = store
  17. Vue.prototype.formatPriceWithSymbol = formatPriceWithSymbol
  18. Vue.prototype.formatPrice = formatPrice
  19. Vue.prototype.formatRate = formatRate
  20. Vue.prototype.formatScore = formatScore
  21. App.mpType = 'app'
  22. const app = new Vue({
  23. store,
  24. render: h => h(App)
  25. })
  26. app.$mount()