검색창 엔터

This commit is contained in:
kimdaae328 2025-02-27 09:54:29 +09:00
parent 22741cb803
commit ed02d33099

View File

@ -4,7 +4,7 @@
<div class="card-header">
<!-- 검색창 -->
<div class="container col-6 mt-12 mb-8">
<search-bar @update:data="search" />
<search-bar @update:data="search" @keyup.enter="searchOnEnter"/>
</div>
</div>
<div class="card-datatable">
@ -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) {