Merge pull request #4669 from VitoBeijing/master

feat: Form表单label国际化适配
This commit is contained in:
yangwei9012 2022-06-21 15:49:37 +08:00 committed by GitHub
commit e17a07be76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,7 +35,8 @@ function FormField(props: FormFieldProps) {
hasError,
isRequired,
label,
description
description,
translate: __
} = props;
const errors = Array.isArray(props.errors)
@ -58,7 +59,7 @@ function FormField(props: FormFieldProps) {
{label ? (
<label className={cx(`Form-label`)}>
<span>
{label}
{__(label)}
{isRequired && label ? (
<span className={cx(`Form-star`)}>*</span>
) : null}