uniapp 单页面开启上拉触底刷新事件
1.在pages.json里面找到你需要开启的那个页面,加上"onReachBottomDistance": 50
{"path": "pages/profit/definite/index","style": {"navigationBarTitleText": "佣金明细","enablePullDownRefresh": false,"onReachBottomDistance": 50//50代表距离底部多少的距离 这个根据自己的需求 一般都是50}},
2.在页面 methods中 添加onReachBottom() //上拉触底事件
onReachBottom() { //上拉触底事件 距离底部50px的时候会触发if (this.list.length < this.total) {this.page++commissionList({page: this.page}).then(res => {this.newlist = res.data.datathis.list = [...this.list, ...this.newlist]})}},
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
