添加方法
在vxe-table组建上添加scroll方法:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17<template>
<div>
<vxe-table
ref="xTable"
border
round
highlight-hover-row
height="200"
@scroll ="scrollEvnt"
:data="tableData">
<vxe-table-column type="seq" title="Number" width="80"></vxe-table-column>
<vxe-table-column field="name" title="Name" sortable></vxe-table-column>
<vxe-table-column field="sex" title="Sex" sortable></vxe-table-column>
<vxe-table-column field="address" title="Address"></vxe-table-column>
</vxe-table>
</div>
</template>methods中添加以下代码
1
2
3
4
5
6
7
8
9
10
11scrollEvnt: function (row) {
// 内容高度
var scrollHeight = row.$event.target.scrollHeight
var clientHeight = row.$event.target.clientHeight
var scrollTop = row.$event.target.scrollTop
console.log(scrollTop, clientHeight, scrollHeight)
console.log(scrollTop + clientHeight >= clientHeight)
if (scrollTop + clientHeight >= scrollHeight) {
console.log('haha,bottom')
}
}
- 本文作者: Harry Liu
- 本文链接: https://www.ser163.cn/2020/08/11/vxe-table-表格判断滚动条是否触底/
- 版权声明: 本博客所有文章除特别声明外,均采用 MIT 许可协议。转载请注明出处!