Package Exports
- @grafikri/vue-infinite-scroll
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@grafikri/vue-infinite-scroll) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
DEMO & DOCS
Install
- Install package
npm i @grafikri/vue-infinite-scroll
- Register it as vue plugin
Don't forget it register before create an Vue instance. here
import VueInfiniteScroll from "@grafikri/vue-infinite-scroll"
Vue.use(VueInfiniteScroll)
- Start to use it as directive in component
<template>
<div v-infinite-scroll="{ onEnter, onLeave, distance: 100 }">
This is my long content
</div>
</template>
<script>
export default {
name: "MyCustomComponent",
methods: {
onEnter() {
// do something
},
onLeave() {
// do something
},
},
}
</script>
Options
Properties
distance
The distance means space between view's and scroll's bottom positions. The value of distance is pixel.
Default: 200
Required:
false
Methods
onEnter
The method when view's bottom appear.
Required:
true
on DOM
onLeave
The method when view's bottom leave.
Required:
true
on DOM