main.js 724 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import App from './App'
  2. import store from './store'
  3. import global from './utils/global.js'
  4. import IndexedDB from '@/utils/IndexedDB'
  5. // #ifndef VUE3
  6. import Vue from 'vue'
  7. import './uni.promisify.adaptor'
  8. Vue.config.productionTip = false
  9. App.mpType = 'app'
  10. // 挂载为全局方法
  11. Vue.prototype.$store = store
  12. Vue.prototype.$global = global
  13. Vue.prototype.$dbHelper = IndexedDB
  14. const app = new Vue({
  15. ...App
  16. })
  17. app.$mount()
  18. // #endif
  19. // #ifdef VUE3
  20. import {
  21. createSSRApp
  22. } from 'vue'
  23. export function createApp() {
  24. const app = createSSRApp(App)
  25. app.config.globalProperties.$store = store
  26. app.config.globalProperties.$global = global
  27. app.config.globalProperties.$dbHelper = IndexedDB
  28. return {
  29. app
  30. }
  31. }
  32. // #endif