From 89ede5d05fab830e3eaaa879868650645e02bea4 Mon Sep 17 00:00:00 2001 From: Alan Wang Date: Tue, 26 Oct 2021 17:19:12 +0800 Subject: [PATCH] fix: popover repeat when exist fixed column in table (#3394) * fix: popover repeat when exist fixed column in table * Update render-helper.ts --- packages/components/table/src/table-body/render-helper.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/components/table/src/table-body/render-helper.ts b/packages/components/table/src/table-body/render-helper.ts index 9e420d5ee3..419fe87b5c 100644 --- a/packages/components/table/src/table-body/render-helper.ts +++ b/packages/components/table/src/table-body/render-helper.ts @@ -32,6 +32,7 @@ function useRender(props: Partial>) { getCellClass, getSpan, getColspanRealWidth, + isColumnHidden, } = useStyles(props) const firstDefaultColumnIndex = computed(() => { return props.store.states.columns.value.findIndex( @@ -107,6 +108,7 @@ function useRender(props: Partial>) { } const baseKey = `${$index},${cellIndex}` const patchKey = columnData.columnKey || columnData.rawColumnKey || '' + const tdChildren = cellChildren(cellIndex, column, data) return h( 'td', { @@ -119,11 +121,14 @@ function useRender(props: Partial>) { handleCellMouseEnter($event, { ...row, tooltipEffect }), onMouseleave: handleCellMouseLeave, }, - [column.renderCell(data)] + [tdChildren] ) }) ) } + const cellChildren = (cellIndex, column, data) => { + return isColumnHidden(cellIndex) ? null : column.renderCell(data) + } const wrappedRowRender = (row: T, $index: number) => { const store = props.store const { isRowExpanded, assertRowKey } = store