From 9ab80cba08f2e1bad8f3d32ea0e828081c7dd3ef Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Thu, 23 Mar 2023 20:10:09 +0800 Subject: [PATCH] fix(app): webview Preference is given to the page background color --- .../src/service/framework/webview/style/backgroundColor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/uni-app-plus/src/service/framework/webview/style/backgroundColor.ts b/packages/uni-app-plus/src/service/framework/webview/style/backgroundColor.ts index 0e6b707561..be73a30064 100644 --- a/packages/uni-app-plus/src/service/framework/webview/style/backgroundColor.ts +++ b/packages/uni-app-plus/src/service/framework/webview/style/backgroundColor.ts @@ -4,7 +4,7 @@ export function initBackgroundColor( webviewStyle: PlusWebviewWebviewStyles, routeMeta: UniApp.PageRouteMeta ) { - const { backgroundColor } = routeMeta + let { backgroundColor } = routeMeta if (!backgroundColor) { return } @@ -13,6 +13,8 @@ export function initBackgroundColor( } if (!webviewStyle.background) { webviewStyle.background = backgroundColor + } else { + backgroundColor = webviewStyle.background } if (!webviewStyle.backgroundColorTop) { webviewStyle.backgroundColorTop = backgroundColor -- GitLab