Vue2的写法
import App from './App'
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
import config from "./static/js/config/config.js"
Vue.prototype.$config=config;
const app = new Vue({
...App
})
app.$mount()
Vue3的写法
import App from './App'
import { createSSRApp} from 'vue'
import config from './static/js/config/config.js'
export function createApp() {
const app = createSSRApp(App)
app.config.globalProperties.$config = config;
return {
app
}
}
使用
console.log(this.$config.baseApi)