diff --git a/components/config-provider/index.tsx b/components/config-provider/index.tsx index a3061677c..d6d564013 100644 --- a/components/config-provider/index.tsx +++ b/components/config-provider/index.tsx @@ -2,7 +2,7 @@ import { reactive, provide, VNodeTypes, PropType, defineComponent, watch } from import PropTypes from '../_util/vue-types'; import defaultRenderEmpty, { RenderEmptyHandler } from './renderEmpty'; import LocaleProvider, { Locale, ANT_MARK } from '../locale-provider'; - +import { TransformCellTextProps } from '../table/interface'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; import { withInstall } from '../_util/type'; @@ -20,6 +20,7 @@ export interface ConfigConsumerProps { rootPrefixCls?: string; getPrefixCls: (suffixCls?: string, customizePrefixCls?: string) => string; renderEmpty: RenderEmptyHandler; + transformCellText?: (tableProps: TransformCellTextProps) => any; csp?: CSPConfig; autoInsertSpaceInButton?: boolean; input?: { @@ -55,6 +56,7 @@ export interface ConfigProviderProps { prefixCls?: string; children?: VNodeTypes; renderEmpty?: RenderEmptyHandler; + transformCellText?: (tableProps: TransformCellTextProps) => any; csp?: CSPConfig; autoInsertSpaceInButton?: boolean; input?: { @@ -89,6 +91,9 @@ const ConfigProvider = defineComponent({ renderEmpty: { type: Function as PropType, }, + transformCellText: { + type: Function as PropType<(tableProps: TransformCellTextProps) => any>, + }, csp: { type: Object as PropType, }, diff --git a/components/table/interface.ts b/components/table/interface.ts index 8e1a9fbaa..6637ca869 100644 --- a/components/table/interface.ts +++ b/components/table/interface.ts @@ -180,6 +180,13 @@ export interface TableState { columns?: ColumnProps[]; } +export interface TransformCellTextProps { + text: any, + column: ColumnProps, + record: any, + index: number +} + // export type SelectionItemSelectFn = (key: string[]) => any; // export interface SelectionItem {