mounted() {
//监听页面滚动事件
window.addEventListener("scroll", this.handleScroll);
}
//methods里面的方法
handleScroll() {
//窗口滚要做的操作写这里
},
mounted() {
//监听页面滚动事件
window.addEventListener("scroll", this.handleScroll);
}
//methods里面的方法
handleScroll() {
//窗口滚要做的操作写这里
},
本文标题:vue.js监听页面滚动事件
本文链接:https://www.haomeiwen.com/subject/bcentqtx.html
网友评论