wip
This commit is contained in:
parent
02e8269793
commit
2dcdb7d29e
|
@ -110,14 +110,17 @@ const init = async (): Promise<void> => {
|
||||||
if (!props.pagination.noPaging && (res.length > (props.pagination.limit || 10))) {
|
if (!props.pagination.noPaging && (res.length > (props.pagination.limit || 10))) {
|
||||||
res.pop();
|
res.pop();
|
||||||
items.value = props.pagination.reversed ? [...res].reverse() : res;
|
items.value = props.pagination.reversed ? [...res].reverse() : res;
|
||||||
|
if (props.externalItemArray) {
|
||||||
|
props.externalItemArray.value = items.value;
|
||||||
|
}
|
||||||
more.value = true;
|
more.value = true;
|
||||||
} else {
|
} else {
|
||||||
items.value = props.pagination.reversed ? [...res].reverse() : res;
|
items.value = props.pagination.reversed ? [...res].reverse() : res;
|
||||||
|
if (props.externalItemArray) {
|
||||||
|
props.externalItemArray.value = items.value;
|
||||||
|
}
|
||||||
more.value = false;
|
more.value = false;
|
||||||
}
|
}
|
||||||
if (props.externalItemArray) {
|
|
||||||
props.externalItemArray.value = items.value;
|
|
||||||
}
|
|
||||||
offset.value = res.length;
|
offset.value = res.length;
|
||||||
error.value = false;
|
error.value = false;
|
||||||
fetching.value = false;
|
fetching.value = false;
|
||||||
|
@ -191,14 +194,17 @@ const fetchMore = async (): Promise<void> => {
|
||||||
if (res.length > SECOND_FETCH_LIMIT) {
|
if (res.length > SECOND_FETCH_LIMIT) {
|
||||||
res.pop();
|
res.pop();
|
||||||
items.value = props.pagination.reversed ? [...res].reverse().concat(items.value) : items.value.concat(res);
|
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;
|
more.value = true;
|
||||||
} else {
|
} else {
|
||||||
items.value = props.pagination.reversed ? [...res].reverse().concat(items.value) : items.value.concat(res);
|
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;
|
more.value = false;
|
||||||
}
|
}
|
||||||
if (props.externalItemArray) {
|
|
||||||
props.externalItemArray.value = items.value;
|
|
||||||
}
|
|
||||||
offset.value += res.length;
|
offset.value += res.length;
|
||||||
moreFetching.value = false;
|
moreFetching.value = false;
|
||||||
}, err => {
|
}, err => {
|
||||||
|
|
Loading…
Reference in New Issue