@whitesev/domutils 2.0.6 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -631,19 +631,19 @@ class ElementEvent extends ElementAnimate {
631
631
  /**
632
632
  * 取消绑定所有的事件
633
633
  * @param element 需要取消绑定的元素|元素数组
634
- * @param eventType (可选)需要取消监听的事件
634
+ * @param eventType (可选)需要取消监听的事件,不传入该参数则遍历所有监听的事件
635
635
  */
636
636
  offAll(element: DOMUtilsElementEventType, eventType?: string): void;
637
637
  /**
638
638
  * 取消绑定所有的事件
639
639
  * @param element 需要取消绑定的元素|元素数组
640
- * @param eventType (可选)需要取消监听的事件
640
+ * @param eventType (可选)需要取消监听的事件,不传入该参数则遍历所有监听的事件
641
641
  */
642
642
  offAll(element: DOMUtilsElementEventType, eventType?: DOMUtils_EventType | DOMUtils_EventType[]): void;
643
643
  /**
644
644
  * 取消绑定所有的事件
645
645
  * @param element 需要取消绑定的元素|元素数组
646
- * @param eventType (可选)需要取消监听的事件
646
+ * @param eventType (可选)需要取消监听的事件,不传入该参数则遍历所有监听的事件
647
647
  */
648
648
  offAll(element: DOMUtilsElementEventType, eventType?: DOMUtils_EventType | DOMUtils_EventType[] | string) {
649
649
  const that = this;
package/src/index.ts CHANGED
@@ -1082,6 +1082,7 @@ class DOMUtils extends ElementHandler {
1082
1082
  }
1083
1083
  // 移除事件
1084
1084
  $el.querySelectorAll("*").forEach(($elItem) => {
1085
+ if (!($elItem instanceof Element)) return;
1085
1086
  this.offAll($elItem);
1086
1087
  });
1087
1088
  this.offAll($el);