mizzkey/packages/frontend-embed/src/components/EmNotes.vue

49 lines
1.1 KiB
Vue
Raw Normal View History

2024-08-21 19:52:44 +09:00
<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
2024-08-28 15:15:22 +09:00
<EmPagination ref="pagingComponent" :pagination="pagination" :disableAutoLoad="disableAutoLoad">
2024-08-21 19:52:44 +09:00
<template #empty>
<div class="_fullinfo">
<div>{{ i18n.ts.noNotes }}</div>
</div>
</template>
<template #default="{ items: notes }">
2024-08-29 12:40:58 +09:00
<div :class="[$style.root]">
<EmNote v-for="note in notes" :key="note._featuredId_ || note._prId_ || note.id" :class="$style.note" :note="note"/>
2024-08-21 19:52:44 +09:00
</div>
</template>
2024-08-28 15:15:22 +09:00
</EmPagination>
2024-08-21 19:52:44 +09:00
</template>
<script lang="ts" setup>
import { shallowRef } from 'vue';
import EmNote from '@/components/EmNote.vue';
2024-08-28 15:15:22 +09:00
import EmPagination, { Paging } from '@/components/EmPagination.vue';
2024-08-21 19:52:44 +09:00
import { i18n } from '@/i18n.js';
const props = withDefaults(defineProps<{
pagination: Paging;
noGap?: boolean;
disableAutoLoad?: boolean;
ad?: boolean;
}>(), {
ad: true,
});
2024-08-28 15:15:22 +09:00
const pagingComponent = shallowRef<InstanceType<typeof EmPagination>>();
2024-08-21 19:52:44 +09:00
defineExpose({
pagingComponent,
});
</script>
<style lang="scss" module>
.root {
2024-08-29 12:40:58 +09:00
background: var(--panel);
2024-08-21 19:52:44 +09:00
}
</style>