mounted() {
window.addEventListener('scroll', this.handleScroll, true)
},
handleScroll(e) {
const scrollTop = e.target.scrollTop
if (scrollTop > 361) {
this.isFixed = true
console.log('固定')
} else {
this.isFixed = true
}
},
vue监听滚动 距离
最新推荐文章于 2023-09-13 16:09:18 发布