main.js 551 B

12345678910111213141516171819202122232425262728
  1. import App from './App'
  2. import toastMixin from './utils/toast-mixin.js'
  3. // #ifndef VUE3
  4. import Vue from 'vue'
  5. import './uni.promisify.adaptor'
  6. Vue.config.productionTip = false
  7. Vue.mixin(toastMixin)
  8. App.mpType = 'app'
  9. const app = new Vue({
  10. ...App
  11. })
  12. app.$mount()
  13. // #endif
  14. // #ifdef VUE3
  15. import { createSSRApp } from 'vue'
  16. import * as Pinia from 'pinia'
  17. export function createApp() {
  18. const app = createSSRApp(App)
  19. app.use(Pinia.createPinia())
  20. app.mixin(toastMixin)
  21. return {
  22. app,
  23. Pinia // 此处必须将 Pinia 返回
  24. }
  25. }
  26. // #endif