参考文档:https://taro-docs.jd.com/taro/docs/tutorial#%E9%A1%B9%E7%9B%AE%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84
其实和微信小程序一样,只要设置页面配置信息并添加对应函数即可
class Index extends Component {
// 添加小程序页面配置信息
config: {
enablePullDownRefresh: true,
onReachBottomDistance: 50
}
onPullDownRefresh() {
console.log('下拉刷新')
setTimeout(() => {
// 停止下拉刷新
Taro.stopPullDownRefresh()
}, 1000)
}
onReachBottom() {
console.log('触底事件,做上拉加载')
}
}
最后
以上就是落寞花生最近收集整理的关于taro开发微信小程序 -- 下拉刷新和上拉加载的全部内容,更多相关taro开发微信小程序内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复