Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

main.js 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import App from './App'
  2. import store from "./stores";
  3. import {
  4. fileURL
  5. } from '@/utils/network/api.js';
  6. //Vue2 内容
  7. // #ifndef VUE3
  8. import Vue from "vue";
  9. import uView from "uview-ui";
  10. Vue.use(uView);
  11. Vue.use(store);
  12. Vue.config.productionTip = false;
  13. App.mpType = "app";
  14. const app = new Vue({
  15. ...App,
  16. });
  17. app.$mount();
  18. // #endif
  19. //Vue3 内容
  20. // #ifdef VUE3
  21. import {
  22. createSSRApp
  23. } from 'vue';
  24. // import request from '@/static/js/network/request.js';
  25. import uView from "@/uni_modules/vk-uview-ui";
  26. import {
  27. useCounterStore
  28. } from "@/stores/counter";
  29. import Vconsole from 'vconsole'
  30. const vConsole1 = new Vconsole()
  31. export function createApp() {
  32. const app = createSSRApp(App);
  33. app.use(store);
  34. app.use(uView);
  35. app.use(vConsole1)
  36. console.log(import.meta.env.VITE_APP_TYPE);
  37. //系统属性全局注册
  38. const counter = useCounterStore();
  39. app.config.globalProperties.$systemInfo = counter.systemInfo
  40. // app.config.globalProperties.$imgUrl = fileURL + "/image/";
  41. // 关闭默认标题栏
  42. uni.getSystemInfo({
  43. success: function(res) {
  44. uni.setStorageSync('__uniapp__statusbar_height', res.statusBarHeight);
  45. }
  46. });
  47. return {
  48. app,
  49. // Pinia, // 此处必须将 Pinia 返回
  50. };
  51. }
  52. // #endif