项目场景:
踩坑-vue3.0-uniapp-全局变量prototype失效
问题描述
踩坑-vue3.0-uniapp-全局变量prototype失效
main.js中全局变量失效
Vue.prototype.$testname = "testNAME";
解决方案:
使用
export function createApp() {
const app = createSSRApp(App)
app.config.globalProperties.$testname = 'testtesta'
// app.config.globalProperties.$testf = testf()
return {
app
}
}