vscroller
v1.0.1
Published
vue scroller infiniteload
Downloads
4
Readme
vscroller
Install
npm install vscroller -S
How to use
<div id="app">
<m-scroller
:on-refresh="refresh"
:on-infinite="infinite"
ref="my_scroller">
<!-- content goes here -->
<ul>
<li v-for="item in items">{{item}}</li>
</ul>
</m-scroller>
</div>
<script>
import scroller from 'vscroller';
export default {
components: {
'm-scroller': scroller
},
data () {
items: []
},
methods: {
refresh: function(){
},
infinite: function(){
this.fetchData();
},
fetchData: function(){
//部分数据加载完成
this.$refs.my_scroller && this.$refs.my_scroller.finishInfinite()
//所有数据加载完成
this.$refs.my_scroller && this.$refs.my_scroller.finishInfinite(true)
}
}
}
</script>