有办法监听scroll-view滑动结束吗?求大神指教~~~
发布于 6 年前 作者 qiangli 10577 次浏览 来自 问答

scroll-view有个bindscroll事件但是在这个事件里面setData会造成页面一直刷~~有办法监听scroll-view滑动结束后再setData吗?

5 回复

@赵子龙    稳

    你搞个定时器不就行了

bindscroll: function () {

    clearTimeout(this.timeoutId);

    this.timeoutId = setTimeout(function () {

        this.setData({

            name: “赵子龙”

        });

        delete this.timeoutId;

    }.bind(this), 500);

}

bindscrolltolower这个事件是滑到底部的~不是滑动结束的~~

好的~谢谢@赵子龙

bindscrolltolower

回到顶部