1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-27 18:54:48 +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,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<div class="_spacer" style="--MI_SPACER-w: 700px;">
<div>
<MkPagination v-slot="{items}" :pagination="pagination" withControl>
<MkPagination v-slot="{items}" :paginator="paginator" withControl>
<MkA v-for="item in items" :key="item.id" :to="`/clips/${item.id}`" :class="$style.item" class="_panel _margin">
<b>{{ item.name }}</b>
<div v-if="item.description" :class="$style.description">{{ item.description }}</div>
@@ -17,21 +17,21 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script lang="ts" setup>
import { computed } from 'vue';
import { computed, markRaw } from 'vue';
import * as Misskey from 'misskey-js';
import MkPagination from '@/components/MkPagination.vue';
import { Paginator } from '@/utility/paginator.js';
const props = defineProps<{
user: Misskey.entities.User;
}>();
const pagination = {
endpoint: 'users/clips' as const,
const paginator = markRaw(new Paginator('users/clips', {
limit: 20,
params: computed(() => ({
computedParams: computed(() => ({
userId: props.user.id,
})),
};
}));
</script>
<style lang="scss" module>