From ae0f778bf80d98b2ebc2e0bd76aa5ead1e79c435 Mon Sep 17 00:00:00 2001 From: heweishui Date: Wed, 19 Jun 2024 11:16:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DrelativeToViewport?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/apis/wxml/IntersectionObserver.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/taro-platform-harmony-hybrid/src/api/apis/wxml/IntersectionObserver.ts b/packages/taro-platform-harmony-hybrid/src/api/apis/wxml/IntersectionObserver.ts index 6df1e1739db0..687bfa30d21e 100644 --- a/packages/taro-platform-harmony-hybrid/src/api/apis/wxml/IntersectionObserver.ts +++ b/packages/taro-platform-harmony-hybrid/src/api/apis/wxml/IntersectionObserver.ts @@ -61,6 +61,7 @@ export class TaroHarmonyHybridIntersectionObserver implements Taro.IntersectionO // 使用时间戳而不是entry.time,跟微信小程序一致 time: Date.now(), id: entry.target.id, + // eslint-disable-next-line dot-notation dataset: entry.target['dataset'] } // web端会默认首次触发 @@ -125,7 +126,7 @@ export class TaroHarmonyHybridIntersectionObserver implements Taro.IntersectionO } public relativeToViewport (margins?: Taro.IntersectionObserver.RelativeToViewportMargins | undefined): Taro.IntersectionObserver { - return this.relativeTo('.taro_page', margins) + return this.relativeTo('.taro_router', margins) } private _getCallbackByElement (element: Element) {