微信小程序下拉刷新

1.在要刷新的界面的XXX.json中设置enablePullDownRefresh设为true   
"enablePullDownRefresh": true

2.利用onPullDownRefresh函数定义下拉动作并结合wx.request()向后台请求数据更新

// 下拉刷新  
onPullDownRefresh:function(){  
 // 动态设置导航条标题  
 wx.setNavigationBarTitle({  
   title: ''  
 });  
 wx.showNavigationBarLoading(); //在标题栏中显示加载图标   下拉刷新

猜你喜欢

转载自blog.csdn.net/qq_41861261/article/details/80743973