From 8ce86658ff06ea7abbae55e81d42bc37fe9347f2 Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 18 Oct 2023 15:40:22 +0800 Subject: [PATCH] fix(BasicTable): headerCell slot title not exist --- src/components/Table/src/hooks/useColumns.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/Table/src/hooks/useColumns.ts b/src/components/Table/src/hooks/useColumns.ts index 1bb8e52..882a22c 100644 --- a/src/components/Table/src/hooks/useColumns.ts +++ b/src/components/Table/src/hooks/useColumns.ts @@ -144,11 +144,9 @@ export function useColumns(propsRef: ComputedRef, getPagination const mapFn = (column) => { const { slots, customRender, format, edit, editRow, flag } = column - if (!slots || !slots?.title) { - // column.slots = { title: `header-${dataIndex}`, ...(slots || {}) }; + if (!slots || !slots?.title) column.customTitle = column.title - Reflect.deleteProperty(column, 'title') - } + const isDefaultAction = [INDEX_COLUMN_FLAG, ACTION_COLUMN_FLAG].includes(flag) if (!customRender && format && !edit && !isDefaultAction) { column.customRender = ({ text, record, index }) => {