From 9a97f2895c8b54b7da5776ef9855d92042c3718e Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Thu, 21 Jul 2022 16:42:39 +0800 Subject: [PATCH] =?UTF-8?q?feat(web-view):=20=E6=94=AF=E6=8C=81=E9=80=9A?= =?UTF-8?q?=E8=BF=87=20webviewStyles=20=E8=AE=BE=E7=BD=AE=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app-plus/view/components/web-view/index.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/platforms/app-plus/view/components/web-view/index.vue b/src/platforms/app-plus/view/components/web-view/index.vue index 02b57cb1d..142b20665 100644 --- a/src/platforms/app-plus/view/components/web-view/index.vue +++ b/src/platforms/app-plus/view/components/web-view/index.vue @@ -12,17 +12,21 @@ import { NAVBAR_HEIGHT } from 'uni-helpers/constants' let webview = false const insertHTMLWebView = ({ + webviewStyles, htmlId, updateTitle }) => { const parentWebview = plus.webview.currentWebview() // fixed by hxy web-view 组件所在的 webview 不注入 uni-app 框架 - const styles = { - 'uni-app': 'none', - isUniH5: true, - // ios 默认绘制到安全区外 - contentAdjust: false - } + const styles = Object.assign( + { + 'uni-app': 'none', + isUniH5: true, + // ios 默认绘制到安全区外 + contentAdjust: false + }, + webviewStyles + ) const parentTitleNView = parentWebview.getTitleNView() if (parentTitleNView) { if (plus.navigator.isImmersedStatusbar()) { @@ -102,6 +106,7 @@ export default { mounted () { this.htmlId = WEBVIEW_ID_PREFIX + this.$page.id insertHTMLWebView({ + webviewStyles: this.webviewStyles, htmlId: this.htmlId, updateTitle: this.updateTitle }) -- GitLab