fix: popover repeat when exist fixed column in table (#3394)

* fix: popover repeat when exist fixed column in table

* Update render-helper.ts
This commit is contained in:
Alan Wang 2021-10-26 17:19:12 +08:00 committed by GitHub
parent 2bd4d533e4
commit 89ede5d05f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,6 +32,7 @@ function useRender<T>(props: Partial<TableBodyProps<T>>) {
getCellClass,
getSpan,
getColspanRealWidth,
isColumnHidden,
} = useStyles(props)
const firstDefaultColumnIndex = computed(() => {
return props.store.states.columns.value.findIndex(
@ -107,6 +108,7 @@ function useRender<T>(props: Partial<TableBodyProps<T>>) {
}
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<T>(props: Partial<TableBodyProps<T>>) {
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