fix query builder requests pagination & pagination loading
This commit is contained in:
parent
79a4594878
commit
6154518cbd
2 changed files with 11 additions and 4 deletions
|
@ -96,6 +96,10 @@ watch(searchString, async () => {
|
|||
}, 600);
|
||||
});
|
||||
|
||||
watch(() => props.totalCount, async () => {
|
||||
currentPage.value = 0;
|
||||
});
|
||||
|
||||
const emit = defineEmits({
|
||||
submit(id: number) {
|
||||
return typeof id == "number";
|
||||
|
@ -151,7 +155,8 @@ const loadPage = (newPage: number | ".") => {
|
|||
if (pageEnd > entryCount.value) pageEnd = entryCount.value;
|
||||
|
||||
let loadedElementCount = filterData(props.items, searchString.value, pageStart, pageEnd).length;
|
||||
if (loadedElementCount < props.maxEntriesPerPage)
|
||||
console.log(loadedElementCount, props.maxEntriesPerPage, pageStart, pageEnd)
|
||||
if (loadedElementCount < props.maxEntriesPerPage && (pageEnd != props.totalCount || loadedElementCount == 0))
|
||||
emit("loadData", pageStart, props.maxEntriesPerPage, searchString.value);
|
||||
|
||||
currentPage.value = newPage;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue