mounted () {
window.addEventListener('scroll',this.handleScroll,true)
},
methods:{
handleScroll (e) {
let scrollY = e.target.scrollTop;
consolo.log(scrollY);
}
【VUE】监听滚动条位置
于 2023-02-24 16:29:07 首次发布
mounted () {
window.addEventListener('scroll',this.handleScroll,true)
},
methods:{
handleScroll (e) {
let scrollY = e.target.scrollTop;
consolo.log(scrollY);
}