|
|
@ -76,7 +76,6 @@ export default { |
|
|
|
clearInterval(this.scrollTimer) // 清除定时器 |
|
|
|
const table = this.$refs.table // 获取DOM元素 |
|
|
|
this.wrapperHeight = table.$el.offsetHeight - 30 |
|
|
|
console.log(this.wrapperHeight) |
|
|
|
// 组件一页能完整展示的数据条数 |
|
|
|
this.displayNum = Math.floor(this.wrapperHeight / 40) |
|
|
|
if (this.tableData.length > this.displayNum) { |
|
|
@ -97,7 +96,6 @@ export default { |
|
|
|
if (this.displayNum && this.displayNum > 0) { |
|
|
|
this.scrollTimer = setInterval(() => { |
|
|
|
// scrollTop = bodyWrapper.scrollTop |
|
|
|
console.log(bodyWrapper.scrollTop, bodyWrapper.scrollTop >= (this.tableData.length - this.displayNum) * 40) |
|
|
|
if (bodyWrapper.scrollTop + this.wrapperHeight >= this.tableData.length * 40) { |
|
|
|
bodyWrapper.scrollTop = 0 |
|
|
|
this.showComplete = true |
|
|
|