首页 > 编程知识 正文

微信小程序开启下拉刷新,微信小程序上滑下滑事件

时间:2023-05-06 04:03:51 阅读:268203 作者:1190

下拉刷新和触碰底部提示 //在共用app.json上设置全局下拉 "window":{ "enablePullDownRefresh": true, "backgroundTextStyle":"dark", "navigationBarBackgroundColor": "#f00", "navigationBarTitleText": "优选首页", "navigationBarTextStyle":"white" }, // 页面相关事件处理函数--监听用户下拉动作 onPullDownRefresh: function () { this.setData({ add:[] }) this.shuju.pagenum=1; this.jieko() }, //页面上拉触底事件的处理函数 onReachBottom() { if(this.shuju.pagenum>=this.data.total){ wx.showToast({ title: '没有更多数据了', }) }else{ this.shuju.pagenum++; if(this.shuju.pagenum==this.data.total){ console.log("111"); } this.jieko() } },

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。