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