Skip to content

Commit 007e94d

Browse files
Update index.jsx
1 parent a6c8b22 commit 007e94d

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

packages/ve-table/src/index.jsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -885,17 +885,13 @@ export default {
885885
},
886886
// 更新 virtual phantom 列表总高度
887887
setVirtualPhantomHeight() {
888-
// 解决数据为空时,虚拟滚动区域高度问题
889-
if (this.virtualScrollPositions.length === 0) {
890-
this.$refs[this.virtualPhantomRef].style.height = "100%";
891-
return;
892-
}
893888
let totalHeight = 0;
894-
895-
totalHeight =
896-
this.virtualScrollPositions[
897-
this.virtualScrollPositions.length - 1
898-
].bottom;
889+
if (this.virtualScrollPositions.length) {
890+
totalHeight =
891+
this.virtualScrollPositions[
892+
this.virtualScrollPositions.length - 1
893+
].bottom;
894+
}
899895

900896
this.$refs[this.virtualPhantomRef].style.height =
901897
totalHeight + "px";

0 commit comments

Comments
 (0)