Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
vue-intersect
Advanced tools
A Vue component to add intersection-observer to a Vue component or HTML element.
A Vue component to add intersection observe a Vue component or HTML element.
The IntersectionObserver is an amazing API which allows you to observe one or more HTMLElement for when it has enterede or left the viewport.
This API has many use cases like, infinite-scroll, lazy-loading or animations when an element enters the viewport.
Simply install using your favorite package manager 🔥
npm install vue-intersect --save
yarn add vue-intersect
The package acts as an abstract component, much like what you may know from keep-alive or transition.
This means that it's basically a "decorator". A component which does not output any markup to the DOM, but adds the functionality under the hood 😱.
<template>
<intersect @intersected="msg = 'Intersected!'">
<div>{{ msg }}</div>
</intersect>
</template>
<script>
import Intersect from 'vue-intersect'
export default {
components: { Intersect },
data () {
return {
msg: 'Not intersected.'
}
},
methods: {
onIntersected () {
alert('Element has intersected.')
}
}
}
</script>
Property | Type | Default | Required | Description |
---|---|---|---|---|
threshold | Array | [0.2] | no | MDN docs |
root | HTMLElement | null | no | MDN docs |
rootMargin | String | 0px 0px 0px 0px | no | MDN docs |
Name | Arguments | Description |
---|---|---|
intersected | none | Event fired on intersected. |
The IntersectionObserver API is not currently available in all browsers (IE11, Safari and iOS Safari). If you intend to support these browsers, you'll need to add a poylfill to your bundle.
WICG IntersectionObserver Polyfill is higly recommended.
FAQs
A Vue component to add intersection-observer to a Vue component or HTML element.
The npm package vue-intersect receives a total of 4,424 weekly downloads. As such, vue-intersect popularity was classified as popular.
We found that vue-intersect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.