@scroll实现
首先有滚动条的div一定要设固定高度,然后overflow:auto;出现滚动条
passive是使滚动更加流畅,减少卡顿,
<!-- 搜索联想弹框 -->
<div class="SearchAssociationBox" @scroll.passive="getScroll($event)"></div>
getScroll(event) {
// 滚动条距离底部的距离scrollBottom
let scrollBottom =
event.target.scrollHeight -
event.target.scrollTop -
event.target.clientHeight
console.log('scrollBottom :>> ', scrollBottom)
if (scrollBottom < 28) {
this.currentPage += 1
this.getPlatformInfo()
}
}
本文地址:https://blog.csdn.net/qq_37939251/article/details/107381730
如对本文有疑问, 点击进行留言回复!!
蒲公英 · JELLY技术周刊 Vol.14: Vue 3 新特性详解
keepalived+haproxy+mycat+mysql高可用搭建配制
vue中子组件的created、mounted生命周期钩子中获取不到props中的值问题
网友评论