Bidirectional infinite-scroll component for Vue.js
npm install v-infinite-scroll> Bidirectional infinite-scroll component for Vue.js
Installation
------------
yarn add v-infinite-scroll
npm i --save v-infinite-scroll
Demo
----
Usage
-----
``js
import Vue from 'vue'
import InfiniteScroll from 'v-infinite-scroll'
// You need a specific loader for CSS files like https://github.com/webpack/css-loader
import 'v-infinite-scroll/dist/v-infinite-scroll.css'
Vue.use(InfiniteScroll)
`
`html`
`html
{{item}} // Your content
``
Properties
----------
| Name | Type | Required | Default value | Info |
|--------------------------|---------|----------|---------------|-----------------------------------------------------|
| loading | Boolean | No | | Must be true if data is being loaded |
| offset | Number | No | 0 | Distance of top or bottom to emit the events |
| onTopScrollsToBottom | Boolean | No | True | When using bidirectional scroll, automatically scrolls to the bottom after load a previous page |
Events
----------
| Name | Info |
|-------------------|--------------------------------------------------|
| top | Triggered after the scroll arrives at the top |
| bottom | Triggered after the scroll arrives at the bottom |
Author
-------
License
-------
This project is licensed under MIT License