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 = ''; };