diff --git a/packages/antd/src/form-item/index.tsx b/packages/antd/src/form-item/index.tsx index fe81f08ffb8..8793253fa7f 100644 --- a/packages/antd/src/form-item/index.tsx +++ b/packages/antd/src/form-item/index.tsx @@ -24,6 +24,7 @@ export interface IFormItemProps { tooltipLayout?: 'icon' | 'text' labelStyle?: React.CSSProperties labelAlign?: 'left' | 'right' + labelFor?: string labelWrap?: boolean labelWidth?: number | string wrapperWidth?: number | string @@ -238,6 +239,7 @@ export const BaseItem: React.FC> = ({ {'*'} )} + {!asterisk && requiredMark === 'optional' && !optionalMarkHidden && ( {locale?.Form?.optional} diff --git a/packages/next/src/form-item/index.tsx b/packages/next/src/form-item/index.tsx index 2adafd2d590..28a592ee8f9 100644 --- a/packages/next/src/form-item/index.tsx +++ b/packages/next/src/form-item/index.tsx @@ -23,6 +23,7 @@ export interface IFormItemProps { tooltip?: React.ReactNode tooltipLayout?: 'icon' | 'text' tooltipIcon?: React.ReactNode + labelFor?: string labelStyle?: React.CSSProperties labelAlign?: 'left' | 'right' labelWrap?: boolean @@ -227,6 +228,7 @@ export const BaseItem: React.FC> = ( {'*'} )} + )