@depeng9527/visible
v1.1.0
Published
Detect when an element is becoming visible or hidden on the page.
Downloads
3
Readme
@kvue/virtual
install
npm install @depeng9527/virtual
import
import Vue from 'vue'
import KObserveVisibility from '@depeng9527/virtual'
Vue.use(KObserveVisibility)
Usage
<div v-observe="{
callback: visibilityChanged,
intersection: {
root: ...,
rootMargin: ...,
throttle: 300,
once: false,
threshold: 0
},
}">
visibilityChanged (isVisible, entry) {
this.isVisible = isVisible
console.log(entry)
},