hotfix: pagination
This commit is contained in:
parent
0e430d1c9d
commit
e9fce9baec
1 changed files with 8 additions and 4 deletions
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue