微信小程序-mpvue-下拉加载,上滑刷新无法触发onReachBottom,onPullDownRefresh
遇到的坑,记录一下,
问题.onReachBottom,onPullDownRefresh无法触发
解决办法:需要将onReachBottom,onPullDownRefresh放到与methods同级的位置,否则无法触发。
具体使用方法:
第一步:定义enablePullDownRefresh,backgroundTextStyle
如果单独引用,则在对应的main.json文件中添加
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark", // 或者light,看自己需求
如果在全局中引入,则在app.json中引入
第二步: 在需要使用的.vue文件中引入onReachBottom,onPullDownRefresh。记得与methods同级!