Skip to content

Commit e628947

Browse files
committed
chore: fix ts error
1 parent 57a438a commit e628947

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/field/src/components/ColorPicker/index.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,16 @@ const FieldColorPicker: ProFieldFC<
6262
text: string;
6363
/** 是否使用旧版本 */
6464
old?: boolean;
65-
} & Partial<ColorPickerProps>
65+
} & Partial<Omit<ColorPickerProps, 'mode'>>
6666
> = (
6767
{ text, mode: type, render, renderFormItem, fieldProps, old },
6868
ref: any,
6969
) => {
7070
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
71-
const ColorPicker = React.useMemo(() => getColorPicker(old), [old]);
71+
const ColorPicker = React.useMemo(
72+
() => getColorPicker(old) as unknown as typeof ColorPickerV4,
73+
[old],
74+
);
7275
const prefixCls = getPrefixCls('pro-field-color-picker');
7376
// 5.5.0 以上版本追加 className
7477
const className = useMemo(() => {
@@ -82,7 +85,7 @@ const FieldColorPicker: ProFieldFC<
8285
mode="read"
8386
ref={ref}
8487
className={className}
85-
// 设置无法 open
88+
// @ts-ignore 设置无法 open
8689
open={false}
8790
/>
8891
);

packages/field/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ import FieldHOC from './FieldHOC';
5252
import advancedFormat from 'dayjs/plugin/advancedFormat';
5353
import isoWeek from 'dayjs/plugin/isoWeek';
5454
import localeData from 'dayjs/plugin/localeData';
55+
import localizedFormat from 'dayjs/plugin/localizedFormat';
5556
import weekday from 'dayjs/plugin/weekday';
5657
import weekOfYear from 'dayjs/plugin/weekOfYear';
57-
import localizedFormat from 'dayjs/plugin/localizedFormat';
5858

5959
import dayjs from 'dayjs';
6060

0 commit comments

Comments
 (0)