分离includeFromEvent函数

This commit is contained in:
Harvey committed 2020-08-24 09:28:59 +08:00
1 parent d475f26dfb
commit dd1ae0f499
9 files changed
+42 -22

No files matched your search

+4
View File
@@ -73,3 +73,7 @@ export function isInViewport(el) {
const horInView = rect.left <= windowWidth && rect.left + rect.width >= 0;
return vertInView && horInView;
}
export function includeFromEvent(event, target) {
return event.composedPath && event.composedPath().indexOf(target) > -1;
}