From a7c27a19e42b38c9f6b970c8892216537366cf1c Mon Sep 17 00:00:00 2001 From: yoon Date: Thu, 27 Feb 2025 09:17:27 +0900 Subject: [PATCH] =?UTF-8?q?update:alert=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/input/FormInput.vue | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/components/input/FormInput.vue b/src/components/input/FormInput.vue index 62e3134..0e4f2f1 100644 --- a/src/components/input/FormInput.vue +++ b/src/components/input/FormInput.vue @@ -14,7 +14,7 @@ :placeholder="title" :disabled="disabled" :min="min" - @focusout="$emit('focusout', modelValue)" + @focusout="$emit('focusout', modelValue)" />
{{ title }}을 확인해주세요. @@ -82,7 +82,8 @@ const props = defineProps({ }); // Emits 정의 -const emits = defineEmits(['update:modelValue', 'focusout']); +const emits = defineEmits(['update:modelValue', 'focusout', 'update:alert']); + // 로컬 상태로 사용하기 위한 `inputValue` const inputValue = ref(props.modelValue); @@ -90,6 +91,11 @@ const inputValue = ref(props.modelValue); // 부모로 데이터 업데이트 watch(inputValue, (newValue) => { emits('update:modelValue', newValue); + + // 값이 입력될 때 `alert`를 false로 설정 + if (newValue.trim() !== '') { + emits('update:alert', false); + } }); // 초기값 동기화 @@ -98,10 +104,7 @@ watch(() => props.modelValue, (newValue) => { inputValue.value = newValue; } }); + + -