created () {
this.listenerFunction();
},
beforeDestroy () {
document.removeEventListener("scroll", this.listenerFunction);
},
method () {
listenerFunction(e) {
document.addEventListener('scroll', this.handleScroll, true);
},
handleScroll () {
console.log(window.pageYOffset)
}
}
vue监听滚动条滚动事件
最新推荐文章于 2024-12-10 16:06:33 发布
2226

被折叠的 条评论
为什么被折叠?



