From 1c613d69a8285142641c64e1ef1c75876d47c074 Mon Sep 17 00:00:00 2001 From: xuanzebin <38971117+xuanzebin@users.noreply.github.com> Date: Wed, 29 May 2024 16:32:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20taroGlobalData=20?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98=20(#1581?= =?UTF-8?q?8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: xuanzebin --- .../taro-platform-harmony/src/runtime-framework/react/app.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/taro-platform-harmony/src/runtime-framework/react/app.ts b/packages/taro-platform-harmony/src/runtime-framework/react/app.ts index 95d6e02134bf..4c45d9dfec2f 100644 --- a/packages/taro-platform-harmony/src/runtime-framework/react/app.ts +++ b/packages/taro-platform-harmony/src/runtime-framework/react/app.ts @@ -196,7 +196,7 @@ export function createReactApp ( const keys = Object.keys(globalData) const descriptors = Object.getOwnPropertyDescriptors(globalData) keys.forEach(key => { - Object.defineProperty(this, key, { + Object.defineProperty(Current?.app || this, key, { configurable: true, enumerable: true, get () { @@ -207,7 +207,7 @@ export function createReactApp ( } }) }) - Object.defineProperties(this, descriptors) + Object.defineProperties(Current?.app || this, descriptors) } app.onCreate?.()