forked from FoundKeyGang/FoundKey
fix pagination.vue lints
This commit is contained in:
parent
b0fdedb264
commit
6fed87f85d
1 changed files with 5 additions and 5 deletions
|
@ -39,8 +39,6 @@ import { onScrollTop, isTopVisible, getScrollPosition, getScrollContainer } from
|
||||||
import MkButton from '@/components/ui/button.vue';
|
import MkButton from '@/components/ui/button.vue';
|
||||||
import { i18n } from '@/i18n';
|
import { i18n } from '@/i18n';
|
||||||
|
|
||||||
const SECOND_FETCH_LIMIT = 30;
|
|
||||||
|
|
||||||
export type Paging<E extends keyof misskey.Endpoints = keyof misskey.Endpoints> = {
|
export type Paging<E extends keyof misskey.Endpoints = keyof misskey.Endpoints> = {
|
||||||
endpoint: E;
|
endpoint: E;
|
||||||
limit: number;
|
limit: number;
|
||||||
|
@ -60,6 +58,8 @@ export type Paging<E extends keyof misskey.Endpoints = keyof misskey.Endpoints>
|
||||||
offsetMode?: boolean;
|
offsetMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const SECOND_FETCH_LIMIT = 30;
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
pagination: Paging;
|
pagination: Paging;
|
||||||
disableAutoLoad?: boolean;
|
disableAutoLoad?: boolean;
|
||||||
|
@ -228,8 +228,8 @@ const prepend = (item: Item): void => {
|
||||||
} else {
|
} else {
|
||||||
queue.value.push(item);
|
queue.value.push(item);
|
||||||
onScrollTop(rootEl.value, () => {
|
onScrollTop(rootEl.value, () => {
|
||||||
for (const item of queue.value) {
|
for (const queueItem of queue.value) {
|
||||||
prepend(item);
|
prepend(queueItem);
|
||||||
}
|
}
|
||||||
queue.value = [];
|
queue.value = [];
|
||||||
});
|
});
|
||||||
|
@ -241,7 +241,7 @@ const append = (item: Item): void => {
|
||||||
items.value.push(item);
|
items.value.push(item);
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeItem = (finder: (item: Item) => boolean) => {
|
const removeItem = (finder: (item: Item) => boolean): void => {
|
||||||
const i = items.value.findIndex(finder);
|
const i = items.value.findIndex(finder);
|
||||||
items.value.splice(i, 1);
|
items.value.splice(i, 1);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue