fix: update observer callback

This commit is contained in:
Gabe Yuan
2024-03-27 14:24:41 +08:00
parent ec6a49f01e
commit dc3c510d57

View File

@@ -58,11 +58,11 @@ export class Translator {
// 显示
_interseObserver = new IntersectionObserver(
(intersections) => {
intersections.forEach((intersection) => {
if (intersection.isIntersecting) {
this._render(intersection.target);
this._interseObserver.unobserve(intersection.target);
(entries, observer) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
observer.unobserve(entry.target);
this._render(entry.target);
}
});
},