@whitesev/utils 2.2.3 → 2.2.5
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.
- package/dist/index.amd.js +5 -1
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +5 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +5 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +5 -1
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +5 -1
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +5 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Utils.d.ts +5 -1
- package/package.json +1 -1
- package/src/Utils.ts +5 -1
|
@@ -1034,8 +1034,12 @@ declare class Utils {
|
|
|
1034
1034
|
* @param target 目标元素
|
|
1035
1035
|
* @param callback 触发的回调
|
|
1036
1036
|
* @param options 观察器配置
|
|
1037
|
+
* @example
|
|
1038
|
+
* Utils.mutationVisible(document.querySelector("div.xxxx"),(entries,observer)=>{
|
|
1039
|
+
* console.log("该元素出现在视图内");
|
|
1040
|
+
* }))
|
|
1037
1041
|
*/
|
|
1038
|
-
|
|
1042
|
+
mutationVisible(target: Element | Element[], callback: (entries: IntersectionObserverEntry[], observer: IntersectionObserver) => void, options?: IntersectionObserverInit): void;
|
|
1039
1043
|
/**
|
|
1040
1044
|
* 去除全局window下的Utils,返回控制权
|
|
1041
1045
|
* @example
|
package/package.json
CHANGED
package/src/Utils.ts
CHANGED
|
@@ -2524,8 +2524,12 @@ class Utils {
|
|
|
2524
2524
|
* @param target 目标元素
|
|
2525
2525
|
* @param callback 触发的回调
|
|
2526
2526
|
* @param options 观察器配置
|
|
2527
|
+
* @example
|
|
2528
|
+
* Utils.mutationVisible(document.querySelector("div.xxxx"),(entries,observer)=>{
|
|
2529
|
+
* console.log("该元素出现在视图内");
|
|
2530
|
+
* }))
|
|
2527
2531
|
*/
|
|
2528
|
-
|
|
2532
|
+
mutationVisible(
|
|
2529
2533
|
target: Element | Element[],
|
|
2530
2534
|
callback: (
|
|
2531
2535
|
entries: IntersectionObserverEntry[],
|