You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import App from './App'
  2. //Vue2 内容
  3. // #ifndef VUE3
  4. import Vue from 'vue'
  5. Vue.config.productionTip = false
  6. App.mpType = 'app'
  7. const app = new Vue({
  8. ...App
  9. })
  10. app.$mount()
  11. // #endif
  12. //Vue3 内容
  13. // #ifdef VUE3
  14. import {
  15. createSSRApp
  16. } from 'vue';
  17. import * as Pinia from 'pinia';
  18. // import request from '@/static/js/network/request.js';
  19. import {
  20. useCounterStore
  21. } from '@/stores/counter';
  22. export function createApp() {
  23. const app = createSSRApp(App);
  24. app.use(Pinia.createPinia());
  25. //系统属性全局注册
  26. const counter = useCounterStore();
  27. app.config.globalProperties.$systemInfo = counter.systemInfo
  28. // 关闭默认标题栏
  29. uni.getSystemInfo({
  30. success: function(res) {
  31. uni.setStorageSync('__uniapp__statusbar_height', res.statusBarHeight);
  32. }
  33. });
  34. return {
  35. app,
  36. Pinia, // 此处必须将 Pinia 返回
  37. };
  38. }
  39. // #endif