diff --git a/packages/uni-app-plus/dist/uni.runtime.esm.js b/packages/uni-app-plus/dist/uni.runtime.esm.js index 8fcf79ee86caf0bc310d3b44c3f1cfcec373d165..0fc1c035b78d3c6ed6cefe7f4c14c008ca2234fd 100644 --- a/packages/uni-app-plus/dist/uni.runtime.esm.js +++ b/packages/uni-app-plus/dist/uni.runtime.esm.js @@ -16803,6 +16803,9 @@ function requireGlobal() { object[key] = global[key]; } return object; +} +function syncDataToGlobal(data) { + extend(global, data); } const providers = { @@ -19577,6 +19580,7 @@ var uni$1 = { getSubNVueById: getSubNVueById, restoreGlobal: restoreGlobal, requireGlobal: requireGlobal, + syncDataToGlobal: syncDataToGlobal, getProvider: getProvider, login: login, getUserInfo: getUserInfo, diff --git a/packages/uni-app-plus/src/service/api/internal/global.ts b/packages/uni-app-plus/src/service/api/internal/global.ts index af0fb9fe93436dd2fea2c628cca374e7d5a7c9bb..7e76516dbfd34091a1df5f2d28b13daacbbd6c67 100644 --- a/packages/uni-app-plus/src/service/api/internal/global.ts +++ b/packages/uni-app-plus/src/service/api/internal/global.ts @@ -2,6 +2,7 @@ import { newSetStatusBarStyle, restoreOldSetStatusBarStyle, } from '../../statusBar' +import { extend } from '@vue/shared' export function restoreGlobal( newVue: unknown, @@ -63,3 +64,7 @@ export function requireGlobal() { } return object } + +export function syncDataToGlobal(data: AnyObject) { + extend(global, data) +}