diff --git a/components/table/hooks/useColumns.tsx b/components/table/hooks/useColumns.tsx index aab022e250..3f1a5304bd 100644 --- a/components/table/hooks/useColumns.tsx +++ b/components/table/hooks/useColumns.tsx @@ -1,10 +1,10 @@ import devWarning from '../../vc-util/devWarning'; -import { renderSlot } from 'vue'; import type { Ref } from 'vue'; import type { ContextSlots } from '../context'; import type { TransformColumns, ColumnsType } from '../interface'; import { SELECTION_COLUMN } from './useSelection'; import { EXPAND_COLUMN } from '../../vc-table'; +import { customRenderSlot } from '../../_util/vnode'; function fillSlots(columns: ColumnsType, contextSlots: Ref) { const $slots = contextSlots.value; @@ -27,7 +27,7 @@ function fillSlots(columns: ColumnsType, contextSlots: R }); if (contextSlots.value.headerCell && !column.slots?.title) { - cloneColumn.title = renderSlot( + cloneColumn.title = customRenderSlot( contextSlots.value, 'headerCell', { diff --git a/components/table/interface.tsx b/components/table/interface.tsx index 1cb05c11eb..9f620049d0 100644 --- a/components/table/interface.tsx +++ b/components/table/interface.tsx @@ -13,7 +13,7 @@ import type { Breakpoint } from '../_util/responsiveObserve'; import type { INTERNAL_SELECTION_ITEM } from './hooks/useSelection'; import type { VueNode } from '../_util/type'; import { tuple } from '../_util/type'; -import type { CSSProperties } from 'vue'; +import type { CSSProperties, VNodeArrayChildren } from 'vue'; // import { TableAction } from './Table'; export type { GetRowKey, ExpandableConfig }; @@ -68,7 +68,10 @@ export interface ColumnTitleProps { filters?: Record; } -export type ColumnTitle = VueNode | ((props: ColumnTitleProps) => VueNode); +type ColumnTitleNode = VueNode | VNodeArrayChildren; +export type ColumnTitle = + | ColumnTitleNode + | ((props: ColumnTitleProps) => ColumnTitleNode); export type FilterValue = (Key | boolean)[]; export type FilterKey = Key[] | null;