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.

61 lines
1.2 KiB

2 weeks ago
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
2 weeks ago
app.config.globalProperties.$http = http
app.config.globalProperties.$util = util
app.config.globalProperties.$siteConfig = siteConfig
2 weeks ago
// H5 端额外挂载 wxJsSdk
// #ifdef H5
2 weeks ago
import wxJsSdk from './common/js/wxJsSdk.js'
app.config.globalProperties.$wxjs = wxJsSdk
2 weeks ago
// #endif
return {
app,
store
}
}
// #endif