vue-intersect
Advanced tools
Comparing version
@@ -9,3 +9,3 @@ import Vue from 'vue/dist/vue.js' | ||
test('It should be a function', () => { | ||
expect(typeof Intersect.created).toBe('function') | ||
expect(typeof Intersect.mounted).toBe('function') | ||
}) | ||
@@ -27,3 +27,2 @@ | ||
const spy = { | ||
created: jest.spyOn(mockedIntersect, 'created'), | ||
mounted: jest.spyOn(mockedIntersect, 'mounted') | ||
@@ -41,3 +40,2 @@ } | ||
expect(spy.created).toHaveBeenCalledTimes(1) | ||
expect(spy.mounted).toHaveBeenCalledTimes(1) | ||
@@ -44,0 +42,0 @@ |
{ | ||
"name": "vue-intersect", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "A Vue component to add intersection-observer to a Vue component or HTML element.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -19,3 +19,3 @@ import Vue from 'vue' | ||
root: { | ||
type: HTMLElement, | ||
type: typeof HTMLElement !== 'undefined' ? HTMLElement : Object, | ||
required: false, | ||
@@ -30,3 +30,3 @@ default: () => null | ||
}, | ||
created () { | ||
mounted () { | ||
this.observer = new IntersectionObserver((entries) => { | ||
@@ -45,4 +45,3 @@ if (!entries[0].isIntersecting) { | ||
}) | ||
}, | ||
mounted () { | ||
this.$nextTick(() => { | ||
@@ -49,0 +48,0 @@ if (this.$slots.default && this.$slots.default.length > 1) { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
17144
-87.44%11
-8.33%310
-1.27%1
Infinity%