From 19777906a4b922fdc37ac18160dadca0ae63dc78 Mon Sep 17 00:00:00 2001 From: yoon Date: Mon, 31 Mar 2025 16:46:39 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=EB=B2=88=20=EC=B2=B4=ED=81=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/user/RegisterForm.vue | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/components/user/RegisterForm.vue b/src/components/user/RegisterForm.vue index 3a6b41d..4740439 100644 --- a/src/components/user/RegisterForm.vue +++ b/src/components/user/RegisterForm.vue @@ -48,7 +48,6 @@ :is-alert="passwordcheckAlert" @update:data="passwordcheck = $event" @update:alert="passwordcheckAlert = $event" - @blur="checkPw" :value="passwordcheck" /> {{ passwordcheckError }} @@ -299,17 +298,6 @@ postcode.value = addressData.postcode; // 우편번호 }; - // 비밀번호 확인 체크 - const checkPw = async () => { - if (password.value !== passwordcheck.value) { - passwordcheckError.value = '비밀번호가 일치하지 않습니다.'; - passwordcheckErrorAlert.value = true; - } else { - passwordcheckError.value = ''; - passwordcheckErrorAlert.value = false; - } - }; - // 색상 중복체크 const checkColorDuplicate = async () => { const response = await $api.get(`/user/checkColor?memberCol=${color.value}`); @@ -358,6 +346,19 @@ } }); + // 비밀번호 확인 + watch([password, passwordcheck], ([newPassword, newPasswordCheck]) => { + if (newPassword && newPasswordCheck) { + if (newPassword !== newPasswordCheck) { + passwordcheckError.value = '비밀번호가 일치하지 않습니다.'; + passwordcheckErrorAlert.value = true; + } else { + passwordcheckError.value = ''; + passwordcheckErrorAlert.value = false; + } + } + }); + // 회원가입 const handleSubmit = async () => {