2023-07-27 07:31:52 +02:00
|
|
|
<!--
|
2024-02-13 16:50:11 +01:00
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
2023-07-27 07:31:52 +02:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-11-15 05:42:04 +01:00
|
|
|
<template>
|
2023-05-14 03:21:56 +02:00
|
|
|
<div style="margin: 1em 0;">
|
2023-03-31 07:14:30 +02:00
|
|
|
<MkNote v-if="note && !block.detailed" :key="note.id + ':normal'" v-model:note="note"/>
|
|
|
|
<MkNoteDetailed v-if="note && block.detailed" :key="note.id + ':detail'" v-model:note="note"/>
|
2020-11-15 05:42:04 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2023-05-14 03:50:21 +02:00
|
|
|
<script lang="ts" setup>
|
2023-12-26 06:19:35 +01:00
|
|
|
import { onMounted, ref } from 'vue';
|
2023-05-14 03:50:21 +02:00
|
|
|
import * as Misskey from 'misskey-js';
|
2023-03-31 07:14:30 +02:00
|
|
|
import MkNote from '@/components/MkNote.vue';
|
|
|
|
import MkNoteDetailed from '@/components/MkNoteDetailed.vue';
|
2024-01-04 10:32:46 +01:00
|
|
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
2020-11-15 05:42:04 +01:00
|
|
|
|
2023-05-14 03:50:21 +02:00
|
|
|
const props = defineProps<{
|
2024-01-30 11:53:53 +01:00
|
|
|
block: Misskey.entities.PageBlock,
|
2023-05-14 03:50:21 +02:00
|
|
|
page: Misskey.entities.Page,
|
|
|
|
}>();
|
2021-01-30 02:59:05 +01:00
|
|
|
|
2023-12-26 06:19:35 +01:00
|
|
|
const note = ref<Misskey.entities.Note | null>(null);
|
2021-01-30 02:59:05 +01:00
|
|
|
|
2023-05-14 03:50:21 +02:00
|
|
|
onMounted(() => {
|
2024-01-30 11:53:53 +01:00
|
|
|
if (props.block.note == null) return;
|
2024-01-04 10:32:46 +01:00
|
|
|
misskeyApi('notes/show', { noteId: props.block.note })
|
2023-05-14 03:50:21 +02:00
|
|
|
.then(result => {
|
|
|
|
note.value = result;
|
|
|
|
});
|
2020-11-15 05:42:04 +01:00
|
|
|
});
|
|
|
|
</script>
|