摘要:
1.获取 let top=document.documentElement.scrollTop || document.body.scrollTop; 2.设置 document.documentElement.scrollTop = document.body.scrollTop=设置的值 阅读全文
摘要:
1、在mounted生命周期函数注册滚动条事件 mounted() { window.addEventListener('scroll', this.windowScroll) } 2、在methods方法里使用 methods: { windowScroll() { // 滚动条距离页面顶部的距离 阅读全文