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.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
import App from './App'
// 公共导入( Vue2 和 Vue3 共用的模块)
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 './uni.promisify.adaptor'
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