選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

main.js 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. export function createApp() {
  30. const app = createSSRApp(App);
  31. app.use(store);
  32. app.use(uView);
  33. //系统属性全局注册
  34. const counter = useCounterStore();
  35. app.config.globalProperties.$systemInfo = counter.systemInfo
  36. // app.config.globalProperties.$imgUrl = fileURL + "/image/";
  37. // 关闭默认标题栏
  38. uni.getSystemInfo({
  39. success: function(res) {
  40. uni.setStorageSync('__uniapp__statusbar_height', res.statusBarHeight);
  41. }
  42. });
  43. return {
  44. app,
  45. // Pinia, // 此处必须将 Pinia 返回
  46. };
  47. }
  48. // #endif