fix(person): 优化验证码输入错误处理逻辑设置焦点到第一个输入框

This commit is contained in:
rd
2025-09-16 11:27:18 +08:00
parent 37e6887e93
commit 473a6e6229

View File

@ -67,8 +67,8 @@ const onSubmit = () => {
if (code === 200) { if (code === 200) {
emits('success', captcha); emits('success', captcha);
} else { } else {
inputRef.value?.[activeIndex.value]?.blur?.();
activeIndex.value = 0; activeIndex.value = 0;
inputRef.value?.[activeIndex.value]?.focus?.();
errorMessage.value = '验证码错误,请检查后重试'; errorMessage.value = '验证码错误,请检查后重试';
isError.value = true; isError.value = true;
codeArray.value.forEach((item) => { codeArray.value.forEach((item) => {