Skip to content

Commit

Permalink
feat: table继承外部的valueTypeMap设置
Browse files Browse the repository at this point in the history
  • Loading branch information
liquanwei.lqw committed Nov 18, 2024
1 parent 0b49d92 commit 4f2f139
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/table/src/Table.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ProCard from '@ant-design/pro-card';
import ProForm, { GridContext } from '@ant-design/pro-form';
import type { ParamsType } from '@ant-design/pro-provider';
import { ProConfigProvider, proTheme, useIntl } from '@ant-design/pro-provider';
import ProConfigContext, { ProConfigProvider, proTheme, useIntl } from '@ant-design/pro-provider';
import {
ErrorBoundary,
editableRowByKey,
Expand Down Expand Up @@ -1020,9 +1020,10 @@ const ProviderTableContainer = <
? React.Fragment
: props.ErrorBoundary || ErrorBoundary;

const context = useContext(ProConfigContext);
return (
<Container initValue={props}>
<ProConfigProvider valueTypeMap={ValueTypeToComponent} needDeps>
<ProConfigProvider valueTypeMap={{...context.valueTypeMap, ...ValueTypeToComponent}} needDeps>
<ErrorComponent>
<ProTable<DataType, Params, ValueType>
defaultClassName={`${getPrefixCls('pro-table')}`}
Expand Down

0 comments on commit 4f2f139

Please sign in to comment.