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 0e6b70756143a3424dd4c8d00e81539bce554808..be73a30064269a9a4108c09697f4e59f2a264bf2 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