main.js 715 B

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