loadMore.js
539 字节
export default {
data() {
return {
query: {
pageNum: 1,
pageSize: 10
},
isRefresh: false,
flag: false, // 上拉触底开关
}
},
// 下拉刷新页面
onPullDownRefresh() {
this.query.pageSize = 10
this.total = 0
this.flag = false
this.showList = []
this.getList()
},
// 上拉触底函数
onReachBottom() {
if(this.flag) return
if(this.query.pageSize >= this.total) return uni.showToast({title: '内容已全部加载完成',duration: 1000})
this.query.pageSize += 10
this.getList()
},
}