Closed tiandiweizun closed 2 weeks ago
Vben Admin V5
手机号登录的时候,当输入的手机号不满足位数或者邮箱输入的格式错误的时候,手机号或者邮箱为VbenInput,而验证码为VbenPinInput,测试发现设置dependencies的disabled无效,而只能在handleSendCode再做一次验证,那么还有更加方便的办法吗,如果再做一次验证的话可以有简单的formapi.validatefield实现吗?能否贴上代码帮忙一下。
const formSchema = computed((): VbenFormSchema[] => { return [ { component: 'VbenInput', componentProps: { placeholder: 'example@example.com', }, fieldName: 'email', label: $t('authentication.email'), rules: z .string() .min(1, { message: $t('authentication.emailTip') }) .email($t('authentication.emailValidErrorTip')), }, { component: 'VbenPinInput', componentProps: { disabled: true, handleSendCode: () => { message.success('发送验证码成功!'); }, maxTime: 10, createText: (countdown: number) => { const text = countdown > 0 ? $t('authentication.sendText', [countdown]) : $t('authentication.sendCode'); return text; }, },
commitid:9cf0573921b45e71a9e82c70af8c34e7428020d4 ,提交于2024-11-09
No response
dependencies 的 disabled 可以支持了。
Version
Vben Admin V5
Describe the bug?
手机号登录的时候,当输入的手机号不满足位数或者邮箱输入的格式错误的时候,手机号或者邮箱为VbenInput,而验证码为VbenPinInput,测试发现设置dependencies的disabled无效,而只能在handleSendCode再做一次验证,那么还有更加方便的办法吗,如果再做一次验证的话可以有简单的formapi.validatefield实现吗?能否贴上代码帮忙一下。
Reproduction
const formSchema = computed((): VbenFormSchema[] => { return [ { component: 'VbenInput', componentProps: { placeholder: 'example@example.com', }, fieldName: 'email', label: $t('authentication.email'), rules: z .string() .min(1, { message: $t('authentication.emailTip') }) .email($t('authentication.emailValidErrorTip')), }, { component: 'VbenPinInput', componentProps: { disabled: true, handleSendCode: () => { message.success('发送验证码成功!'); }, maxTime: 10, createText: (countdown: number) => { const text = countdown > 0 ? $t('authentication.sendText', [countdown]) : $t('authentication.sendCode'); return text; }, },
System Info
Relevant log output
No response
Validations