Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-intersect

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-intersect - npm Package Compare versions

Comparing version 1.1.6 to 3.0.0

29

dist/index.js

@@ -1,12 +0,3 @@

import Vue from 'vue';
var warn = function warn(msg) {
if (!Vue.config.silent) {
console.warn(msg);
}
};
export default {
name: 'intersect',
abstract: true,
props: {

@@ -35,2 +26,3 @@ threshold: {

},
emits: ['destroyed', 'enter', 'change', 'leave'],
mounted: function mounted() {

@@ -53,14 +45,18 @@ var _this = this;

var slot = this.$slots.default();
this.$nextTick(function () {
if (_this.$slots.default && _this.$slots.default.length > 1) {
warn('[VueIntersect] You may only wrap one element in a <intersect> component.');
} else if (!_this.$slots.default || _this.$slots.default.length < 1) {
warn('[VueIntersect] You must have one child inside a <intersect> component.');
if (!slot || slot.length < 1) {
console.warn('[VueIntersect] You must have one child inside a <intersect> component.');
return;
}
_this.observer.observe(_this.$slots.default[0].elm);
slot.filter(function (node) {
return node.el;
}).forEach(function (node) {
_this.observer.observe(node.el);
});
});
},
destroyed: function destroyed() {
unmounted: function unmounted() {
this.$emit('destroyed');

@@ -70,4 +66,5 @@ this.observer.disconnect();

render: function render() {
return this.$slots.default ? this.$slots.default[0] : null;
var slot = this.$slots.default();
return slot || null;
}
};
{
"name": "vue-intersect",
"version": "1.1.6",
"version": "3.0.0",
"description": "A Vue component to add intersection-observer to a Vue component or HTML element.",

@@ -16,6 +16,5 @@ "main": "dist/index.js",

"peerDependencies": {
"vue": "^2.4.2"
"vue": "^3.0.7"
},
"devDependencies": {
"vue": "^2.4.2",
"babel-cli": "^6.24.1",

@@ -22,0 +21,0 @@ "babel-core": "^6.25.0",

@@ -1,12 +0,3 @@

import Vue from 'vue'
const warn = (msg) => {
if (!Vue.config.silent) {
console.warn(msg)
}
}
export default {
name: 'intersect',
abstract: true,
props: {

@@ -29,2 +20,3 @@ threshold: {

},
emits: [ 'destroyed', 'enter', 'change', 'leave' ],
mounted () {

@@ -45,14 +37,16 @@ this.observer = new IntersectionObserver((entries) => {

const slot = this.$slots.default()
this.$nextTick(() => {
if (this.$slots.default && this.$slots.default.length > 1) {
warn('[VueIntersect] You may only wrap one element in a <intersect> component.')
} else if (!this.$slots.default || this.$slots.default.length < 1) {
warn('[VueIntersect] You must have one child inside a <intersect> component.')
if (!slot || slot.length < 1) {
console.warn('[VueIntersect] You must have one child inside a <intersect> component.')
return
}
this.observer.observe(this.$slots.default[0].elm)
slot.filter(node => node.el).forEach(node => {
this.observer.observe(node.el)
})
})
},
destroyed () {
unmounted () {
this.$emit('destroyed')

@@ -62,4 +56,5 @@ this.observer.disconnect()

render () {
return this.$slots.default ? this.$slots.default[0] : null
const slot = this.$slots.default()
return slot || null
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc