uniapp监测滚动到底部加载下一页的数据。

uniapp有检测滚动到·底部的方法  onReachBottom    

思路就是首先判断当前页有没有大于总页数,大于总页数就提示,小于就调用接口加载下一页,这样的写法是为了避免发出没有必要的请求。

onReachBottom() {
            if (this.FormData.page < this.totalPage) {
                this.FormData.page++
                this.UpdateAuditList()
                console.log('触底了', this.FormData.page);
            } else {
                uni.showToast({
                    title: '最后一页了',
                    icon: 'none'
                })
            }
        },

你可能感兴趣的:(uni-app,前端,vue.js)