main.js 656 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import App from './App'
  2. // 全局 Mixin
  3. import mixin from './common/mixin/mixin'
  4. Vue.mixin(mixin)
  5. // 全局 Util
  6. import {
  7. msg,
  8. isLogin,
  9. debounce,
  10. throttle,
  11. prePage,
  12. date
  13. } from '@/common/js/util'
  14. Vue.prototype.$util = {
  15. msg,
  16. isLogin,
  17. debounce,
  18. throttle,
  19. prePage,
  20. date
  21. }
  22. // 全局 Store
  23. import store from './store'
  24. Vue.prototype.$store = store
  25. // #ifndef VUE3
  26. import Vue from 'vue'
  27. Vue.config.productionTip = false
  28. App.mpType = 'app'
  29. const app = new Vue({
  30. ...App
  31. })
  32. app.$mount()
  33. // #endif
  34. // #ifdef VUE3
  35. import { createSSRApp } from 'vue'
  36. export function createApp() {
  37. const app = createSSRApp(App)
  38. return {
  39. app
  40. }
  41. }
  42. // #endif