From 1629b88e7120d3900e63d2136c9a18c4b3db6ee7 Mon Sep 17 00:00:00 2001 From: GuoMingXiang <2591354012@qq.com> Date: Sun, 16 Jul 2023 23:08:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AD=90=E5=BA=94=E7=94=A8=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20getElementById=20args=E4=B8=BAObject=E6=97=B6?= =?UTF-8?q?=E6=8A=A5=E9=94=99=EF=BC=8C=E5=BA=94=E8=BF=94=E5=9B=9Enull;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/wujie-core/src/proxy.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/wujie-core/src/proxy.ts b/packages/wujie-core/src/proxy.ts index b545d9f2..45e9a797 100644 --- a/packages/wujie-core/src/proxy.ts +++ b/packages/wujie-core/src/proxy.ts @@ -146,6 +146,8 @@ export function proxyGenerator( if (ctx !== iframe.contentDocument) { return ctx[propKey]?.apply(ctx, args); } + // 部分组件库会利用 args 为 HtmlElement 时返回null,判断插入位置 + if (typeof args[0] !== "string") return null; return ( target.call(shadowRoot, `[id="${args[0]}"]`) || iframe.contentWindow.__WUJIE_RAW_DOCUMENT_QUERY_SELECTOR__.call(