From 8e45ee854463ba38ccc49031411c687c10044032 Mon Sep 17 00:00:00 2001 From: spademan Date: Mon, 12 Sep 2016 16:43:24 +0800 Subject: [PATCH] =?UTF-8?q?Table=20:=20=E8=A7=A3=E5=86=B3=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E6=9F=90=E4=B8=80=E5=88=97=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=E5=9C=A8=E5=86=BB=E7=BB=93=E5=88=97?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E8=A2=AB=E6=8B=96=E5=8A=A8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/table/src/table.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/table/src/table.vue b/packages/table/src/table.vue index aae62baec..9b96a0a6c 100644 --- a/packages/table/src/table.vue +++ b/packages/table/src/table.vue @@ -227,7 +227,6 @@ if (this.fixedColumnCount > 0) { let fixedBodyWidth = 0; let fixedColumnCount = this.fixedColumnCount; - columns.forEach(function(column, index) { if (index < fixedColumnCount) { fixedBodyWidth += column.realWidth; @@ -252,7 +251,6 @@ const bodyHeight = (height - headerHeight); const gridWrapper = this.$el.querySelector('.el-table__body-wrapper'); gridWrapper.style.height = bodyHeight + 'px'; - this.$el.style.height = height + 'px'; if (this.$refs.fixed) { this.$refs.fixed.style.height = height + 'px'; @@ -420,8 +418,9 @@ this.$nextTick(() => { const style = this.$refs.fixed.style; if (!style) return; - style.height = this.$el.clientHeight + 'px'; - + // style.height = this.$el.clientHeight + 'px'; + // 存在横向滚动条的时候应该要减去滚动条的高度 + style.height = (this.showHScrollBar ? this.$el.clientHeight - this.currentGutterWidth : this.$el.clientHeight) + 'px'; // 若非固定列中的某行内容被撑高, 需要固定列中对应行高度与其保持一致 let bodyHeight = this.$el.querySelector('.el-table__body-wrapper').offsetHeight; let fixedBodyHeight = this.$el.querySelector('.el-table__fixed-body-wrapper').offsetHeight;