검색 이벤트 추가

This commit is contained in:
nevermoregb 2024-12-19 11:28:14 +09:00
parent 618814acfd
commit cc748e6d32
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<template>
<div class="input-group mb-3 bg-white">
<input type="text" class="form-control" placeholder="Search" @change="searchInput" />
<input type="text" class="form-control" placeholder="Search" @change="search" />
<button type="button" class="btn btn-primary"><i class="bx bx-search bx-md"></i></button>
</div>
</template>
@ -17,7 +17,7 @@
});
const emits = defineEmits(['update:data']);
const searchInput = function (event) {
const search = function (event) {
//Type Number maxlength
if (event.target.value.length > props.maxlength) {
event.target.value = event.target.value.slice(0, props.maxlength);

View File

@ -1,6 +1,6 @@
<template>
<div class="container-xxl flex-grow-1 container-p-y">
<search-bar @update:data="searchText = $event" />
<search-bar @update:data="search" />
<div class="row g-3">
<div class="mt-8">
@ -44,6 +44,10 @@
const goDetail = idx => {
router.push(`/board/get/${idx}`);
};
const search = e => {
console.log('검색:', e);
};
</script>
<style></style>