mounted(){ // 监听(绑定)滚轮滚动事件 window.addEventListener('scroll', this.handleScroll, true); } destroyed(){ // 离开页面清除(移除)滚轮滚动事件 window.removeEventListener('scroll', this.handleScroll); }, handleScroll(){ $(document).scrollTop() },
暂无评论