123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import App from './App'
- import store from "./stores";
- import {
- fileURL
- } from '@/utils/network/api.js';
-
- //Vue2 内容
- // #ifndef VUE3
- import Vue from "vue";
- import uView from "uview-ui";
- Vue.use(uView);
- Vue.use(store);
- Vue.config.productionTip = false;
- App.mpType = "app";
- const app = new Vue({
- ...App,
- });
- app.$mount();
- // #endif
-
- //Vue3 内容
- // #ifdef VUE3
- import {
- createSSRApp
- } from 'vue';
- // import request from '@/static/js/network/request.js';
- import uView from "@/uni_modules/vk-uview-ui";
- import {
- useCounterStore
- } from "@/stores/counter";
- // import Vconsole from 'vconsole'
- // const vConsole1 = new Vconsole()
- export function createApp() {
- const app = createSSRApp(App);
- window.addEventListener("resize", function() {
- if (
- document.activeElement.tagName == "INPUT" ||
- document.activeElement.tagName == "TEXTAREA"
- ) {
- window.setTimeout(function() {
- document.activeElement.scrollIntoViewIfNeeded();
- }, 0);
- }
- });
-
- app.use(store);
- app.use(uView);
- // app.use(vConsole1)
- console.log(import.meta.env.VITE_APP_TYPE, 'main');
- //系统属性全局注册
- const counter = useCounterStore();
- app.config.globalProperties.$systemInfo = counter.systemInfo
- // app.config.globalProperties.$imgUrl = fileURL + "/image/";
- // 关闭默认标题栏
- uni.getSystemInfo({
- success: function(res) {
- uni.setStorageSync('__uniapp__statusbar_height', res.statusBarHeight);
- }
- });
- return {
- app,
- // Pinia, // 此处必须将 Pinia 返回
- };
- }
-
- // #endif
|