vue-intersect
Advanced tools
Comparing version 1.1.5 to 1.1.6
@@ -17,7 +17,7 @@ import Vue from 'vue'; | ||
default: function _default() { | ||
return [0.2]; | ||
return [0, 0.2]; | ||
} | ||
}, | ||
root: { | ||
type: HTMLElement, | ||
type: typeof HTMLElement !== 'undefined' ? HTMLElement : Object, | ||
required: false, | ||
@@ -36,3 +36,3 @@ default: function _default() { | ||
}, | ||
created: function created() { | ||
mounted: function mounted() { | ||
var _this = this; | ||
@@ -53,10 +53,7 @@ | ||
}); | ||
}, | ||
mounted: function mounted() { | ||
var _this2 = this; | ||
this.$nextTick(function () { | ||
if (_this2.$slots.default && _this2.$slots.default.length > 1) { | ||
if (_this.$slots.default && _this.$slots.default.length > 1) { | ||
warn('[VueIntersect] You may only wrap one element in a <intersect> component.'); | ||
} else if (!_this2.$slots.default || _this2.$slots.default.length < 1) { | ||
} else if (!_this.$slots.default || _this.$slots.default.length < 1) { | ||
warn('[VueIntersect] You must have one child inside a <intersect> component.'); | ||
@@ -66,6 +63,7 @@ return; | ||
_this2.observer.observe(_this2.$slots.default[0].elm); | ||
_this.observer.observe(_this.$slots.default[0].elm); | ||
}); | ||
}, | ||
destroyed: function destroyed() { | ||
this.$emit('destroyed'); | ||
this.observer.disconnect(); | ||
@@ -72,0 +70,0 @@ }, |
{ | ||
"name": "vue-intersect", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "A Vue component to add intersection-observer to a Vue component or HTML element.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
17987
330