diff --git a/packages/form/src/components/LoginForm/demos/login-form.tsx b/packages/form/src/components/LoginForm/demos/login-form.tsx index 530bf7b5d040..2952d3fce394 100644 --- a/packages/form/src/components/LoginForm/demos/login-form.tsx +++ b/packages/form/src/components/LoginForm/demos/login-form.tsx @@ -88,7 +88,7 @@ export default () => { } return 'poor'; }, - getPercent: (value) => { + getPercent: (status, value) => { if (value && value.length > 12) { return 100; } diff --git a/packages/form/src/components/Text/index.tsx b/packages/form/src/components/Text/index.tsx index a0bb85825e4a..6c65ee1cbd3e 100644 --- a/packages/form/src/components/Text/index.tsx +++ b/packages/form/src/components/Text/index.tsx @@ -43,7 +43,7 @@ const passwordProgressMap = { export type PasssWordStrengthProps = { getStatus?: (value?: string) => PasswordStatus; statusRender?: (status: PasswordStatus, value?: string) => React.ReactNode; - getPercent?: (value?: string) => number; + getPercent?: (status: PasswordStatus, value?: string) => number; popoverProps?: PopoverProps; strengthText?: React.ReactNode; }; @@ -73,7 +73,7 @@ const PasssWordStrength: React.FC< style={{ width: '100%', }} - percent={props.getPercent?.(value) || 0} + percent={props.getPercent?.(status, value) || 0} showInfo={false} /> ) : null; @@ -95,13 +95,15 @@ const PasssWordStrength: React.FC< > {props?.statusRender?.(status, value)} {getPasswordProgressDom()} -