This commit is contained in:
cutestnekoaqua 2023-01-19 00:00:36 +01:00
parent 6fa628c581
commit 3bf62edd66

View File

@ -110,14 +110,17 @@ const init = async (): Promise<void> => {
if (!props.pagination.noPaging && (res.length > (props.pagination.limit || 10))) {
res.pop();
items.value = props.pagination.reversed ? [...res].reverse() : res;
if (props.externalItemArray) {
props.externalItemArray.value = items.value;
}
more.value = true;
} else {
items.value = props.pagination.reversed ? [...res].reverse() : res;
if (props.externalItemArray) {
props.externalItemArray.value = items.value;
}
more.value = false;
}
if (props.externalItemArray) {
props.externalItemArray.value = items.value;
}
offset.value = res.length;
error.value = false;
fetching.value = false;
@ -191,14 +194,17 @@ const fetchMore = async (): Promise<void> => {
if (res.length > SECOND_FETCH_LIMIT) {
res.pop();
items.value = props.pagination.reversed ? [...res].reverse().concat(items.value) : items.value.concat(res);
if (props.externalItemArray) {
props.externalItemArray.value = items.value;
}
more.value = true;
} else {
items.value = props.pagination.reversed ? [...res].reverse().concat(items.value) : items.value.concat(res);
if (props.externalItemArray) {
props.externalItemArray.value = items.value;
}
more.value = false;
}
if (props.externalItemArray) {
props.externalItemArray.value = items.value;
}
offset.value += res.length;
moreFetching.value = false;
}, err => {