VUE监听滚动条事件
滚动条
created(){ document.addEventListener('scroll', this.handleScroll) }, beforeDestroy () { document.removeEventListener('scroll', this.handleScroll); }, methods: { handleScroll(){ var a = document.getElementsByClassName('ted-header')[0].offsetHeight; console.log(window.pageYOffset,a) }, }