main.js 617 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import App from './App.vue'
  2. import {
  3. routeInterceptor
  4. } from './routeInterceptor.js'
  5. // #ifndef VUE3
  6. import Vue from 'vue'
  7. Vue.config.productionTip = false
  8. App.mpType = 'app'
  9. const app = new Vue({
  10. ...App
  11. })
  12. app.$mount()
  13. // #endif
  14. // #ifdef VUE3
  15. import {
  16. createSSRApp
  17. } from 'vue'
  18. import * as Pinia from 'pinia';
  19. import utils from "@/utils/utils.js";
  20. import share from "@/utils/share.js";
  21. export function createApp() {
  22. const app = createSSRApp(App)
  23. app.use(routeInterceptor)
  24. app.use(Pinia.createPinia());
  25. app.mixin(share)
  26. app.config.globalProperties.$utils = utils
  27. return {
  28. app,
  29. Pinia
  30. }
  31. }
  32. // #endif