From e5ee94b639115b0693686dcb240e564f6342492f Mon Sep 17 00:00:00 2001 From: Pithy <66438036+awspi@users.noreply.github.com> Date: Mon, 17 Apr 2023 11:25:25 +0800 Subject: [PATCH] fix: table-misaligned when frozen columns (#140) --- packages/vue/src/grid/src/table/src/methods.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/vue/src/grid/src/table/src/methods.ts b/packages/vue/src/grid/src/table/src/methods.ts index a6c7b1d53..80048a363 100644 --- a/packages/vue/src/grid/src/table/src/methods.ts +++ b/packages/vue/src/grid/src/table/src/methods.ts @@ -924,6 +924,11 @@ const Methods = { rightBody && (rightBody.$el.scrollTop = top) } }, + //同步headerHeight + syncHeaderHeight() { + let headerEl = this.$refs.tableHeader?.$el + if (headerEl) this.headerHeight = headerEl.offsetHeight + }, updateStyle() { let { $refs, columnStore, currentRow, height, maxHeight, minHeight, parentHeight, tableColumn } = this let containerList = ['main', 'left', 'right'] @@ -952,6 +957,8 @@ const Methods = { }) currentRow && this.setCurrentRow(currentRow) this.syncFixedTop() + // Fixed issue #129 + this.syncHeaderHeight() return this.$nextTick() }, // 处理固定列的显示状态