From 72e6a6d06f785c0f27936fa32cadac28e92c932d Mon Sep 17 00:00:00 2001 From: Amy0104 <97265214+Amy0104@users.noreply.github.com> Date: Thu, 5 May 2022 14:40:27 +0800 Subject: [PATCH] [Feature][UI Next][V1.0.0-Beta] Add hints to the password repeat. (#9888) --- .../src/views/password/index.tsx | 17 ++++++-- .../src/views/password/use-form.ts | 40 +++++++++++-------- 2 files changed, 38 insertions(+), 19 deletions(-) diff --git a/dolphinscheduler-ui-next/src/views/password/index.tsx b/dolphinscheduler-ui-next/src/views/password/index.tsx index a2eaf8fb59..44621c46ab 100644 --- a/dolphinscheduler-ui-next/src/views/password/index.tsx +++ b/dolphinscheduler-ui-next/src/views/password/index.tsx @@ -24,10 +24,10 @@ import Card from '@/components/card' const password = defineComponent({ name: 'password', setup() { - const { state, t } = useForm() + const { state, rules, t } = useForm() const { handleUpdate } = useUpdate(state) - return { ...toRefs(state), t, handleUpdate } + return { ...toRefs(state), t, handleUpdate, rules } }, render() { const { t } = this @@ -37,17 +37,28 @@ const password = defineComponent({ {{ default: () => (
- + { + this.rPasswordFormItemRef.validate({ + trigger: 'password-input' + }) + }} /> { + if (value) { + return state.passwordForm.password === value } + return true } } - } as FormRules - }) + ] + } as FormRules - return { state, t } + return { state, rules, t } }