mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-25 23:44:01 +02:00
refactor(frontend): improve pagination implementation
This commit is contained in:
@@ -31,7 +31,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<MkFolder v-if="$i" :defaultOpen="true">
|
||||
<template #label>{{ i18n.ts._reversi.myGames }}</template>
|
||||
<MkPagination :pagination="myGamesPagination" :disableAutoLoad="true">
|
||||
<MkPagination :paginator="myGamesPaginator">
|
||||
<template #default="{ items }">
|
||||
<div :class="$style.gamePreviews">
|
||||
<MkA v-for="g in items" :key="g.id" v-panel :class="[$style.gamePreview, !g.isStarted && !g.isEnded && $style.gamePreviewWaiting, g.isStarted && !g.isEnded && $style.gamePreviewActive]" tabindex="-1" :to="`/reversi/g/${g.id}`">
|
||||
@@ -58,7 +58,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
<MkFolder :defaultOpen="true">
|
||||
<template #label>{{ i18n.ts._reversi.allGames }}</template>
|
||||
<MkPagination :pagination="gamesPagination" :disableAutoLoad="true">
|
||||
<MkPagination :paginator="gamesPaginator">
|
||||
<template #default="{ items }">
|
||||
<div :class="$style.gamePreviews">
|
||||
<MkA v-for="g in items" :key="g.id" v-panel :class="[$style.gamePreview, !g.isStarted && !g.isEnded && $style.gamePreviewWaiting, g.isStarted && !g.isEnded && $style.gamePreviewActive]" tabindex="-1" :to="`/reversi/g/${g.id}`">
|
||||
@@ -105,7 +105,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onDeactivated, onMounted, onUnmounted, ref } from 'vue';
|
||||
import { markRaw, onDeactivated, onMounted, onUnmounted, ref } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { useInterval } from '@@/js/use-interval.js';
|
||||
import { misskeyApi } from '@/utility/misskey-api.js';
|
||||
@@ -120,19 +120,18 @@ import { useRouter } from '@/router.js';
|
||||
import * as os from '@/os.js';
|
||||
import { pleaseLogin } from '@/utility/please-login.js';
|
||||
import * as sound from '@/utility/sound.js';
|
||||
import { Paginator } from '@/utility/paginator.js';
|
||||
|
||||
const myGamesPagination = {
|
||||
endpoint: 'reversi/games' as const,
|
||||
const myGamesPaginator = markRaw(new Paginator('reversi/games', {
|
||||
limit: 10,
|
||||
params: {
|
||||
my: true,
|
||||
},
|
||||
};
|
||||
}));
|
||||
|
||||
const gamesPagination = {
|
||||
endpoint: 'reversi/games' as const,
|
||||
const gamesPaginator = markRaw(new Paginator('reversi/games', {
|
||||
limit: 10,
|
||||
};
|
||||
}));
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user