From 617b6506c2572bccbfb83b5b4a5fd3b00d80443f Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Mon, 28 Dec 2020 19:11:18 +0100 Subject: [PATCH] fix: support `threshold` option not being a number --- src/directives/observe-visibility.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/directives/observe-visibility.js b/src/directives/observe-visibility.js index 1992846..a2cb8e1 100644 --- a/src/directives/observe-visibility.js +++ b/src/directives/observe-visibility.js @@ -9,7 +9,7 @@ class VisibilityState { } get threshold () { - return (this.options.intersection && this.options.intersection.threshold) || 0 + return this.options.intersection && typeof this.options.intersection.threshold === 'number' ? this.options.intersection.threshold : 0 } createObserver (options, vnode) {