fix: update observer callback
This commit is contained in:
@@ -58,11 +58,11 @@ export class Translator {
|
|||||||
|
|
||||||
// 显示
|
// 显示
|
||||||
_interseObserver = new IntersectionObserver(
|
_interseObserver = new IntersectionObserver(
|
||||||
(intersections) => {
|
(entries, observer) => {
|
||||||
intersections.forEach((intersection) => {
|
entries.forEach((entry) => {
|
||||||
if (intersection.isIntersecting) {
|
if (entry.isIntersecting) {
|
||||||
this._render(intersection.target);
|
observer.unobserve(entry.target);
|
||||||
this._interseObserver.unobserve(intersection.target);
|
this._render(entry.target);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user