member pagination search
This commit is contained in:
parent
da0408cc4d
commit
acdeef47bf
3 changed files with 13 additions and 9 deletions
|
@ -1,9 +1,10 @@
|
|||
<template>
|
||||
<div class="grow flex flex-col gap-2 overflow-hidden">
|
||||
<div v-if="useSearch" class="relative self-end">
|
||||
<div v-if="useSearch" class="relative self-end flex flex-row items-center gap-2">
|
||||
<Spinner v-if="deferingSearch" />
|
||||
<input
|
||||
type="text"
|
||||
class="w-64 rounded-md shadow-sm relative block px-3 py-2 pr-5 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
|
||||
class="!max-w-64 !w-64 rounded-md shadow-sm relative block px-3 py-2 pr-5 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm"
|
||||
placeholder="Suche"
|
||||
v-model="searchString"
|
||||
/>
|
||||
|
@ -87,11 +88,14 @@ const slots = defineSlots<{
|
|||
const timer = ref(undefined) as undefined | any;
|
||||
const currentPage = ref(0);
|
||||
const searchString = ref("");
|
||||
const deferingSearch = ref(false)
|
||||
|
||||
watch(searchString, async () => {
|
||||
deferingSearch.value = true
|
||||
clearTimeout(timer.value);
|
||||
timer.value = setTimeout(() => {
|
||||
currentPage.value = 0;
|
||||
deferingSearch.value = false
|
||||
emit("search", searchString.value);
|
||||
}, 600);
|
||||
});
|
||||
|
@ -108,7 +112,7 @@ const emit = defineEmits({
|
|||
return typeof offset == "number" && typeof offset == "number" && typeof searchString == "number";
|
||||
},
|
||||
search(search: string) {
|
||||
return typeof search == "number";
|
||||
return typeof search == "string";
|
||||
},
|
||||
clickRow(elem: T) {
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue