hotfix: pagination

This commit is contained in:
Julian Krauser 2024-12-30 10:54:52 +01:00
parent 0e430d1c9d
commit e9fce9baec

View file

@ -20,10 +20,10 @@
<slot
v-else
name="pageRow"
v-for="(item, index) in items"
v-for="(item, index) in visibleRows"
:key="index"
:row="item"
@click="$emit('clickRow', item.id)"
@click="$emit('clickRow', item)"
>
<p>{{ item }}</p>
</slot>
@ -106,7 +106,7 @@ const emit = defineEmits({
search(search: string) {
return typeof search == "number";
},
clickRow(id: FieldType) {
clickRow(elem: T) {
return true;
},
});
@ -163,7 +163,11 @@ const filterData = (array: Array<any>, searchString: string, start: number, end:
(elem) =>
!props.enablePreSearch ||
searchString.trim() == "" ||
props.config.some((col) => typeof elem?.[col.key] == "string" && elem[col.key].includes(searchString.trim()))
props.config.some(
(col) =>
typeof elem?.[col.key] == "string" &&
elem[col.key].toLowerCase().includes(searchString.trim().toLowerCase())
)
)
.filter((elem, index) => (elem?.tab_pos ?? index) >= start && (elem?.tab_pos ?? index) < end);
};