mounted() {
this.$nextTick(() => {
// 添加滚动事件
window.addEventListener('scroll', this.scrollWindow)
})
},
methods() {
scrollWindow() {
var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
},
destroyed() {
// 离开取消监听滚动事件
window.removeEventListener('scroll', this.scrollWindow)
},
},
beforeDestroy() {
this.destroyed()
},
vue监听滚动事件
猜你喜欢
转载自blog.csdn.net/qq719756146/article/details/87362433
今日推荐
周排行