在VUE中监听窗口的滚动高度
mounted () {
window.addEventListener('scroll', this.handleScroll)
}
methods: {
handleScroll () {
console.log(document.documentElement.scrollTop)
// console.log(document.documentElement.clientHeight)
}
},
查看4道真题和解析
