From f9eba1afe5980608a991139b3ec318e7669ff044 Mon Sep 17 00:00:00 2001 From: qiang Date: Sat, 10 Oct 2020 12:02:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20App=E3=80=81H5=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E4=BF=A1=E6=81=AF=E6=9C=AA=E5=8C=85=E5=90=AB?= =?UTF-8?q?=20computedStyle=20=E7=9A=84=E9=97=AE=E9=A2=98=20question/10838?= =?UTF-8?q?7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bridge/subscribe/api/request-component-info.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/view/bridge/subscribe/api/request-component-info.js b/src/core/view/bridge/subscribe/api/request-component-info.js index 40849792f..0b1304df2 100644 --- a/src/core/view/bridge/subscribe/api/request-component-info.js +++ b/src/core/view/bridge/subscribe/api/request-component-info.js @@ -62,7 +62,7 @@ function getNodeInfo (el, fields) { } } // TODO 组件 props - if (fields.properties) { + if (Array.isArray(fields.properties)) { fields.properties.forEach(prop => { prop = prop.replace(/-([a-z])/g, function (e, t) { return t.toUpperCase() @@ -76,8 +76,16 @@ function getNodeInfo (el, fields) { } else { info.scrollLeft = 0 info.scrollTop = 0 + info.scrollHeight = 0 + info.scrollWidth = 0 } } + if (Array.isArray(fields.computedStyle)) { + const sytle = getComputedStyle(el) + fields.computedStyle.forEach(name => { + info[name] = sytle[name] + }) + } if (fields.context) { if (el.__vue__ && el.__vue__._getContextInfo) { info.context = el.__vue__._getContextInfo() -- GitLab