js向上滚动加载历史数据
Vue数据加载 (vue-data-loading)
Another component for infinite scroll and pull down/up to load data.
无限滚动和向下/向上加载数据的另一个组件。
安装 (Install)
npm install vue-data-loading --save
用法 (Usage)
Import first:
首先导入:
import VueDataLoading from 'vue-data-loading'
Register as a component:
注册为组件:
components: {
VueDataLoading
},
The only you need to do is wrapping your data with vue-data-loading
tag.
您唯一需要做的就是使用vue-data-loading
标签包装数据。
<vue-data-loading>
<ul>
<li v-for="(item, index) in list" :key="index">Item: {
{item}}</li>
</ul>
</vue-data-loading>
However, you can pass some props
or events
to the component.
但是,您可以将一些props
或events
传递给组件。
<vue-data-loading :loading="loading" :listens="['pull-down', 'infinite-scroll']" @infinite-scroll="infiniteScroll" @pull-down="pullDown">
<!--your data here-->
</vue-data-loading>
Sometimes, yo