From f84206bff0aed9c28a4de03a8f4d30722596bfbc Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Fri, 17 Sep 2021 13:45:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dshow-summary?= =?UTF-8?q?=E3=80=81fixed=E5=90=8C=E6=97=B6=E5=AD=98=E5=9C=A8=EF=BC=8C?= =?UTF-8?q?=E4=B8=94max-height=E8=AE=BE=E7=BD=AE=E7=9A=84=E6=AF=94?= =?UTF-8?q?=E5=AE=9E=E9=99=85=E9=AB=98=E5=BA=A6=E9=AB=98=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8C=E5=90=88=E8=AE=A1=E8=A2=AB=E9=A1=B6=E5=87=BA?= =?UTF-8?q?=E5=8E=BB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/table/table.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/table/table.vue b/src/components/table/table.vue index 1ac90c47..ef14b503 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -497,7 +497,12 @@ let style = {}; if (this.bodyHeight !== 0) { let height = this.bodyHeight - (this.showHorizontalScrollBar?this.scrollBarWidth:0); - style.height = this.showHorizontalScrollBar ? `${height}px` : `${height - 1}px`; + if(this.height) { + style.height = this.showHorizontalScrollBar ? `${height}px` : `${height - 1}px`; + } else if (this.maxHeight) { + style.maxHeight = this.showHorizontalScrollBar ? `${height}px` : `${height - 1}px`; + } + } return style; }, From 11f2367589987ca11af8729b7d115b8a69c50841 Mon Sep 17 00:00:00 2001 From: Aresn Date: Fri, 17 Sep 2021 14:58:55 +0800 Subject: [PATCH 2/2] simplify --- src/components/table/table.vue | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/table/table.vue b/src/components/table/table.vue index ef14b503..00409fa7 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -497,12 +497,9 @@ let style = {}; if (this.bodyHeight !== 0) { let height = this.bodyHeight - (this.showHorizontalScrollBar?this.scrollBarWidth:0); - if(this.height) { - style.height = this.showHorizontalScrollBar ? `${height}px` : `${height - 1}px`; - } else if (this.maxHeight) { - style.maxHeight = this.showHorizontalScrollBar ? `${height}px` : `${height - 1}px`; - } - + const bodyHeight = this.showHorizontalScrollBar ? `${height}px` : `${height - 1}px`; + if (this.height) style.height = bodyHeight; + else if (this.maxHeight) style.maxHeight = bodyHeight; } return style; },