This commit is contained in:
khj0414 2025-03-10 14:24:49 +09:00
commit aac2e21c08

View File

@ -11,7 +11,14 @@
</div> -->
<!-- 텍스트박스 -->
<div class="w-100">
<textarea class="form-control" placeholder="댓글 달기" rows="3" :maxlength="maxLength" v-model="comment"></textarea>
<textarea
class="form-control"
placeholder="댓글 달기"
rows="3"
:maxlength="maxLength"
v-model="comment"
@input="alertTextHandler"
></textarea>
<span v-if="commentAlert" class="invalid-feedback d-block text-start ms-2">{{ commentAlert }}</span>
<span v-else class="invalid-feedback d-block text-start ms-2">{{ textAlert }}</span>
</div>
@ -35,6 +42,7 @@
class="form-control flex-grow-1"
v-model="password"
placeholder="비밀번호 입력"
@input="passwordAlertTextHandler"
/>
<span v-if="passwordAlert" class="invalid-feedback d-block text-start ms-2">{{ passwordAlert }}</span>
<span v-else class="invalid-feedback d-block text-start ms-2">{{ passwordAlert2 }}</span>
@ -89,6 +97,14 @@
const emit = defineEmits(['submitComment']);
const alertTextHandler = () => {
textAlert.value = '';
};
const passwordAlertTextHandler = () => {
passwordAlert2.value = '';
};
const handleCommentSubmit = () => {
if (!$common.isNotEmpty(comment.value)) {
textAlert.value = '댓글을 입력하세요';