微信小程序下拉不触发onPullDownRefresh

微信小程序下拉onpulldownrefresh不触发

简单记录下微信小程序下拉不触发方法的问题
1.下拉出发需要在app.json中配置下拉的内容

  "window": {
    
    
        "backgroundTextStyle": "light",
        "navigationBarBackgroundColor": "#FDEBE7",
        "navigationBarTitleText": "享券快客",
        "navigationBarTextStyle": "black",
        "enablePullDownRefresh":true,
        "backgroundColor": "#efefef"
    },

无效原因

  • 对应的每个页面都会有这样一个生命周期 onPullDownRefresh
  • 在页面的js文件中写入才会有用,在app.js中写无效
 onPullDownRefresh: function () {
    
    
    console.log('下拉刷新')
  },

猜你喜欢

转载自blog.csdn.net/weixin_44000173/article/details/126005825