From 48dd6c5b9c720b75b82748a63c4b8b670fb2161f Mon Sep 17 00:00:00 2001 From: yoon Date: Fri, 28 Mar 2025 15:11:00 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=EB=B0=80=EB=B2=88=ED=98=B8=204?= =?UTF-8?q?=EC=9E=90=EB=A6=AC=20alert=20=EB=88=84=EB=9D=BD=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/user/RegisterForm.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/user/RegisterForm.vue b/src/components/user/RegisterForm.vue index aea85d2..726df69 100644 --- a/src/components/user/RegisterForm.vue +++ b/src/components/user/RegisterForm.vue @@ -332,9 +332,12 @@ }; watch(password, (newValue) => { - if (newValue.length >= 4) { + if (newValue && newValue.length >= 4) { passwordErrorAlert.value = false; passwordError.value = ''; + } else if (newValue && newValue.length < 4) { + passwordErrorAlert.value = true; + passwordError.value = '비밀번호는 4자리 이상이어야 합니다.'; } }); @@ -342,6 +345,7 @@ // 회원가입 const handleSubmit = async () => { await checkColorDuplicate(); + idAlert.value = id.value.trim() === ''; passwordAlert.value = password.value.trim() === ''; passwordcheckAlert.value = passwordcheck.value.trim() === ''; @@ -351,8 +355,8 @@ addressAlert.value = address.value.trim() === ''; phoneAlert.value = phone.value.trim() === ''; - // 비밀번호 길이 체크 로직 추가 - if (password.value.length < 4) { + // 비밀번호 길이 체크 로직 수정 + if (password.value && password.value.length < 4) { passwordErrorAlert.value = true; passwordError.value = '비밀번호는 4자리 이상이어야 합니다.'; } else {