From ed02d33099dd60349060e874bf0c85a9f5c0fb42 Mon Sep 17 00:00:00 2001 From: kimdaae328 Date: Thu, 27 Feb 2025 09:54:29 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B2=80=EC=83=89=EC=B0=BD=20=EC=97=94?= =?UTF-8?q?=ED=84=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/board/BoardList.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/views/board/BoardList.vue b/src/views/board/BoardList.vue index 6276ea4..095e5e3 100644 --- a/src/views/board/BoardList.vue +++ b/src/views/board/BoardList.vue @@ -4,7 +4,7 @@
- +
@@ -257,6 +257,18 @@ const fetchNoticePosts = async () => { } }; +// Enter 키를 눌렀을 때 +const searchOnEnter = (event) => { + const searchTextValue = event.target.value.trim(); + + if (!searchTextValue || searchTextValue[0] === ' ') { + return; // 검색어가 비어있거나 첫 글자가 공백이면 실행 안 함 + } + + searchText.value = searchTextValue; + fetchGeneralPosts(1); +}; + // 페이지 변경 const handlePageChange = (page) => { if (page !== pagination.value.currentPage) {