From 5326af856c78f311176a6d0125791e324910a53a Mon Sep 17 00:00:00 2001 From: yutent Date: Thu, 13 Apr 2023 18:27:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=8B=E4=BB=B6=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E5=9C=A8=E5=BD=B1=E5=AD=90=E8=8A=82=E7=82=B9=E4=B8=8A?= =?UTF-8?q?=E6=97=B6=E6=97=A0=E6=B3=95=E8=87=AA=E5=8A=A8=E9=94=80=E6=AF=81?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/utils.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index c2be029..02e168c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bd/core", - "version": "1.8.7", + "version": "1.8.8", "type": "module", "description": "百搭UI组件库的核心", "main": "dist/index.js", diff --git a/src/utils.js b/src/utils.js index e9f95c7..ca1bec1 100644 --- a/src/utils.js +++ b/src/utils.js @@ -89,9 +89,9 @@ export function bind(dom, type, selector, fn, phase = true) { fn = fn || noop } - if (isWc === false && dom !== document && dom !== document.body) { - let node = dom.parentNode - while (node) { + if (isWc === false) { + let node = dom + while (node && node !== document.body && node !== document) { if (node.ownHost) { isWc = true host = node.ownHost