1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-21 19:15:32 +02:00

refactor(frontend): improve pagination implementation

This commit is contained in:
syuilo
2025-06-29 15:11:25 +09:00
parent 8bc822d829
commit f1deb89e34
68 changed files with 1067 additions and 1138 deletions

View File

@@ -6,16 +6,16 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<div class="_gaps">
<MkInfo>{{ i18n.ts._fileViewer.thisPageCanBeSeenFromTheAuthor }}</MkInfo>
<MkNotesTimeline ref="tlComponent" :pagination="pagination"/>
<MkNotesTimeline :paginator="paginator"/>
</div>
</template>
<script lang="ts" setup>
import { ref, computed } from 'vue';
import { ref, computed, markRaw } from 'vue';
import { i18n } from '@/i18n.js';
import type { PagingCtx } from '@/composables/use-pagination.js';
import MkInfo from '@/components/MkInfo.vue';
import MkNotesTimeline from '@/components/MkNotesTimeline.vue';
import { Paginator } from '@/utility/paginator.js';
const props = defineProps<{
fileId: string;
@@ -23,11 +23,10 @@ const props = defineProps<{
const realFileId = computed(() => props.fileId);
const pagination = ref<PagingCtx>({
endpoint: 'drive/files/attached-notes',
const paginator = markRaw(new Paginator('drive/files/attached-notes', {
limit: 10,
params: {
fileId: realFileId.value,
},
});
}));
</script>