แก้ฟิลเตอร์ สรรหา

This commit is contained in:
setthawutttty 2025-02-26 16:04:28 +07:00
parent 3bfb6687e8
commit 50e5652b43
13 changed files with 216 additions and 104 deletions

View file

@ -9,8 +9,9 @@ const filterRef = ref<any>(null);
const initialPagination = ref<Pagination>({
rowsPerPage: 0,
});
const filter = defineModel<string>("filter", { required: true });
const props = defineProps({
onSearch: Function,
count: Number,
pass: Number,
notpass: Number,
@ -133,21 +134,15 @@ function resetFilter() {
<q-input
standout
dense
:model-value="inputfilter"
v-model="filter"
ref="filterRef"
@update:model-value="updateInput"
outlined
placeholder="ค้นหา"
style="max-width: 200px"
@keydown.enter="props.onSearch?.()"
>
<template v-slot:append>
<q-icon v-if="inputfilter == ''" name="search" />
<q-icon
v-if="inputfilter !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
<q-icon name="search" />
</template>
</q-input>
<!-- แสดงคอลมนใน table -->