README
INSTALL
npm i -S v-in-viewport
USAGE
<div v-in-viewport="log_one"></div>
<!-- fn is your function name -->
<div v-in-viewport="{ fn: log_two, npm: 'InViewport', delay: 1000, msg: 'a message' }"></div>
<script>
import InViewport from 'v-in-viewport'
new Vue({
directives: {
InViewport
},
methods: {
log_one () {
console.log('span is in view port now')
},
// delay 1000ms
log_two ({ npm, msg }) {
console.log(npm, msg)
}
}
})
</script>