<div ref="id" style="overflow:auto">
<div ref="inid">
</div>
</div>
this.$refs.id.addEventListener('scroll', this.ScrollListener)
ScrollListener(e) {
// console.log(e)
// 获取内容的高度
let innerHeight = this.$refs.inid.clientHeight
//滚动头部的距离
let scrollTop = e.target.scrollTop
let contactsRefHeight = this.$refs.id.clientHeight
if (scrollTop + contactsRefHeight + 1 >= innerHeight) {
if(this.total > this.pageNo*10) {
this.getRangeList()
}
console.log("到底了")
}
},
overflow 滚到底部刷新
最新推荐文章于 2024-07-08 16:22:29 发布