From fabb1c2c3f76005ebe892a302d064dc7c5a7b899 Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Tue, 11 Mar 2025 16:21:20 +0900 Subject: [PATCH] =?UTF-8?q?=EC=88=98=EC=A0=95=20,=EC=82=AD=EC=A0=9C?= =?UTF-8?q?=EC=8B=9C=20=EB=B9=84=EB=B0=80=EB=B2=88=ED=98=B8=20=ED=8F=BC?= =?UTF-8?q?=EC=97=90=20=EA=B3=B5=EB=B0=B1=20=EB=B0=A9=EC=A7=80=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/board/BoardComment.vue | 7 ++++++- src/components/board/BoardCommentArea.vue | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/board/BoardComment.vue b/src/components/board/BoardComment.vue index 387fad7..c34b6d0 100644 --- a/src/components/board/BoardComment.vue +++ b/src/components/board/BoardComment.vue @@ -24,7 +24,7 @@ class="form-control" :value="password" placeholder="비밀번호 입력" - @input="$emit('update:password', $event.target.value.trim())" + @input="filterInput" /> @@ -122,6 +122,11 @@ 'update:password', ]); + const filterInput = (event) => { + event.target.value = event.target.value.replace(/\s/g, ""); // 공백 제거 + emit("update:password", event.target.value); + }; + const localEditedContent = ref(props.comment.content); // 댓글 입력 창 토글 diff --git a/src/components/board/BoardCommentArea.vue b/src/components/board/BoardCommentArea.vue index d607cf6..fcfd8e3 100644 --- a/src/components/board/BoardCommentArea.vue +++ b/src/components/board/BoardCommentArea.vue @@ -103,7 +103,8 @@ textAlert.value = ''; }; - const passwordAlertTextHandler = () => { + const passwordAlertTextHandler = (event) => { + event.target.value = event.target.value.replace(/\s/g, ""); passwordAlert2.value = ''; };