import App from './App.vue' import * as Pinia from 'pinia'; import { createSSRApp } from 'vue' export function createApp() { const app = createSSRApp(App) app.use(uviewPlus) app.use(Pinia.createPinia()); // 在js里直接调用 uni.$platform = uni.getSystemInfoSync().platform uni.$statusBarHeight = uni.getSystemInfoSync().statusBarHeight // 在html模板里直接调用 app.config.globalProperties.$platform = uni.getSystemInfoSync().platform app.config.globalProperties.$statusBarHeight = uni.getSystemInfoSync().statusBarHeight // 兼容写法, 否则真机可能会找不到pinia return { Pinia, app } }标签:uniapp,无需,app,statusBarHeight,platform,import,uni,全局,getSystemInfoSync From: https://www.cnblogs.com/anans/p/17863107.html