记录一次开发中遇到的问题
page的滚动条事件
let timer = null
pageScroll(e) {
// 将你所要检测的值置为false
store.dispatch('showActivityBox', false);
clearTimeout(timer);// 清空定时器
timer = setTimeout(function () {
// 此时页面滚动结束触发
store.dispatch('showActivityBox', true);
}, 500)
}
// 这样做了之后感觉页面有延迟,showActivityBox的值变化的原因,在加上handletouchend事件就暂时可以实现想要的功能了。
handletouchend(){
store.dispatch('showActivityBox', true);
},复制代码