beforeDestroy() { //在组件生命周期结束的时候销毁。
window.removeEventListener('scroll', this.scrollhandle);
},
methods: {
listenerAction() { //开始监听
window.addEventListener('scroll', this.scrollhandle);
}
},
scrollhandle(event) {
var scrollY = event.path[1].scrollY;
},
网友评论