在VUE中监听窗口的滚动高度
mounted () { window.addEventListener('scroll', this.handleScroll) } methods: { handleScroll () { console.log(document.documentElement.scrollTop) // console.log(document.documentElement.clientHeight) } },
mounted () { window.addEventListener('scroll', this.handleScroll) } methods: { handleScroll () { console.log(document.documentElement.scrollTop) // console.log(document.documentElement.clientHeight) } },
相关推荐