uniapp scroll-view防抖
<scroll-view @scroll="scroll" @scrolltolower="scrolltolower" :scroll-anchoring="true" scroll-y scroll-with-animation :scroll-top="scrollTop"class="wh"></scroll-view>scrollTop: 0,old: {scro
·
<scroll-view @scroll="scroll" @scrolltolower="scrolltolower" :scroll-anchoring="true" scroll-y scroll-with-animation :scroll-top="scrollTop" class="wh">
</scroll-view>
scrollTop: 0,
old: {
scrollTop: 0
},
// 滚动
scroll(e) {
// this.scrollTop = e.detail.scrollTop
this.old.scrollTop = e.detail.scrollTop
}
// 返回顶部吧
returnTop() {
this.scrollTop = this.old.scrollTop
this.$nextTick(() => {
this.scrollTop = 0
})
},
更多推荐
已为社区贡献1条内容
所有评论(0)