修复事件绑定在影子节点上时无法自动销毁的bug

pull/1/head 1.8.8
yutent 2023-04-13 18:27:37 +08:00
parent 948c4e08c6
commit 5326af856c
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@bd/core",
"version": "1.8.7",
"version": "1.8.8",
"type": "module",
"description": "百搭UI组件库的核心",
"main": "dist/index.js",

View File

@ -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