From 4f93c8fb5d141825f359e310581c1d5262acc790 Mon Sep 17 00:00:00 2001 From: qiang Date: Thu, 4 Jul 2019 17:17:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20IntersectionObserver=20=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E6=96=B9=E6=B3=95=20relativeTo=20relativeToViewport?= =?UTF-8?q?=20=E6=94=AF=E6=8C=81=E9=93=BE=E5=BC=8F=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/service/api/create-intersection-observer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/service/api/create-intersection-observer.js b/src/core/service/api/create-intersection-observer.js index 9d20cd0c3..c184e113b 100644 --- a/src/core/service/api/create-intersection-observer.js +++ b/src/core/service/api/create-intersection-observer.js @@ -20,10 +20,12 @@ class MPIntersectionObserver { relativeTo (selector, margins) { this.options.relativeToSelector = selector this._makeRootMargin(margins) + return this } relativeToViewport (margins) { this.options.relativeToSelector = null this._makeRootMargin(margins) + return this } observe (selector, callback) { if (typeof callback !== 'function') { -- GitLab