overflow: auto 后监听滚动距离
<div class
="page-body-inner" @scroll.passive
="getScroll($event)"></div
>
getScroll
(e
) {
console.log
(e.target.scrollTop
)
},
if 想要点击之后 从顶部开始滚动 方法如下
<div id
="over"> </div
>
document.getElementById
('over').scrollTop
=0
;
转载请注明原文地址:https://tech.qufami.com/read-8546.html