一、在app.json中启动下拉
在Windows 中,
添加 “enablePullDownRefresh”:true
注:1.enablePullDownRefresh要加引号
2.是true
,不是"true"
字符串
二、在需要刷新的页面中写(若是单个页面),反之,可写入app.js中:
onPullDownRefresh: function () {
wx.showNavigationBarLoading() //在标题栏中显示加载
setTimeout(function () {
// complete 此处放刷新事件
wx.hideNavigationBarLoading() //完成 停止加载
wx.stopPullDownRefresh() //停止下拉刷新
}, 1500);
},
注:这个是模拟下拉刷新页面。若需要实时下拉刷新数据,需获取动态数据