import App from './App' // 公共导入(Vue2 和 Vue3 共用的模块) import './uni.promisify.adaptor' import http from './common/js/http.js' import util from './common/js/util.js' import siteConfig from './common/js/siteConfig.js' // #ifdef H5 import wxJsSdk from './common/js/wxJsSdk.js' // #endif // #ifndef VUE3 import Vue from 'vue' import './uni.promisify.adaptor' Vue.config.productionTip = false // 挂载全局属性 Vue.prototype.$http = http Vue.prototype.$util = util Vue.prototype.$siteConfig = siteConfig // H5 端额外挂载 wxJsSdk // #ifdef H5 Vue.prototype.$wxjs = wxJsSdk // #endif App.mpType = 'app' const app = new Vue({ ...App }) app.$mount() // #endif // #ifdef VUE3 import { createSSRApp } from 'vue' import tabbar from './components/tabbar/tabbar.vue' import store from './store' export function createApp() { const app = createSSRApp(App) app.use(store) // 挂载全局属性(替代 Vue2 的 prototype) // app.config.globalProperties.$http = http // app.config.globalProperties.$util = util // app.config.globalProperties.$siteConfig = siteConfig // H5 端额外挂载 wxJsSdk // #ifdef H5 // import wxJsSdk from './common/js/wxJsSdk.js' // app.config.globalProperties.$wxjs = wxJsSdk // #endif return { app, store } } // #endif