Skip to content

Commit 5f17983

Browse files
authored
Merge pull request #403 from zhangjiayu1215/master
fix: virtualPhantomHeight
2 parents 5d72ce8 + 007e94d commit 5f17983

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/ve-table/src/index.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -886,11 +886,12 @@ export default {
886886
// 更新 virtual phantom 列表总高度
887887
setVirtualPhantomHeight() {
888888
let totalHeight = 0;
889-
890-
totalHeight =
891-
this.virtualScrollPositions[
892-
this.virtualScrollPositions.length - 1
893-
].bottom;
889+
if (this.virtualScrollPositions.length) {
890+
totalHeight =
891+
this.virtualScrollPositions[
892+
this.virtualScrollPositions.length - 1
893+
].bottom;
894+
}
894895

895896
this.$refs[this.virtualPhantomRef].style.height =
896897
totalHeight + "px";

0 commit comments

Comments
 (0)