uniapp onPullDownRefresh 下拉刷新小坑

        onPullDownRefresh() {
            uni.request({
                url:''
                success: (res) => {
                    uni.stopPullDownRefresh()
                }
            })
        },

在做小程序的时候经常遇上下拉刷新的需求,但是这里有个小坑,如果不使用uni.stopPullDownRefresh(),刷新就不会自动停止,所以一定要在业务代码结束后使用uni.stopPullDownRefresh()(或者是在回调中,比如我的例子就是在网络请求的回调中使用)

猜你喜欢

转载自www.cnblogs.com/zhangpooo/p/12622105.html