vue滚动条事件(获取滚动条距离底部距离)
<div class="main" @scroll.passive="getScroll($event)" style="height:100px;overflow:auto;">
<ul>
<li>内容</li>
</ul>
</div>
.main{
width: calc(1125vw / 11.25);
height: 100%;
overflow-y: scroll;
}
getScroll(event) {
// 滚动条距离底部的距离scrollBottom let scrollBottom = event.target.scrollHeight - event.target.scrollTop - event.target.clientHeight; // if (this.finished && scrollBottom < 40) { // 操作 // } },

浙公网安备 33010602011771号