xiaocheng555 / el-table-virtual-scroll

基于Element-UI的Table 组件开发的虚拟滚动组件,支持动态高度,解决数据量大时滚动卡顿的问题。
224 stars 41 forks source link

el-table初始高度为0,且父级有没滚动容器,会导致滚动事件不触发。 #98

Closed zhaoky0310 closed 3 weeks ago

zhaoky0310 commented 3 weeks ago

// 如果表格是固定高度,则获取表格内的滚动节点,否则获取父层滚动节点 if (this.elTable && (this.elTable.height || this.elTable.maxHeight)) { this.isInnerScroll = true return this.$el.querySelector('.el-table__body-wrapper') } else { return getParentScroller(this.$el) } 源码第266行左右 如果height初始为0,this.elTable.height 会为false 这个时候如果父级容器没有滚动条,则会出现异常情况,建议这个地方加上数字0校验。

自身项目初始为表格高度为0,后续会计算其实际高度,但是这个地方取表格高度的时候还是0。

xiaocheng555 commented 3 weeks ago

好的

xiaocheng555 commented 3 weeks ago

版本 1.4.5 已修复

xiaocheng555 commented 3 weeks ago

版本 1.4.6 已修复,1.4.5有点问题