<div class="full-width table-box v-layout " ref='settlement' @scroll.passive="scrollEvt"></div>
js
scrollEvt() {
let scrollTargetBox = this.$refs.settlement
scrollTargetBox.onscroll = () => {
let scrollHeight = scrollTargetBox.scrollHeight;
let scrollTop = scrollTargetBox.scrollTop;
let clientHeight = scrollTargetBox.clientHeight;
if (scrollHeight - clientHeight === scrollTop) {
//滚动条滚到最底部
if (this.pages.current >= this.totalPage) return
this.pages.current++;
this.getList(this.pages, 'add')
}
}
},
这里为了偷懒通过ref 去取得元素,哈哈哈哈