2023-07-27 05:31:52 +00:00
|
|
|
<!--
|
2024-02-13 15:59:27 +00:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 05:31:52 +00:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2019-04-29 00:11:57 +00:00
|
|
|
<template>
|
2023-05-30 08:37:38 +00:00
|
|
|
<component :is="getComponent(block.type)" :key="block.id" :page="page" :block="block" :h="h"/>
|
2019-04-29 00:11:57 +00:00
|
|
|
</template>
|
|
|
|
|
2023-05-14 01:50:21 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
|
|
|
import * as Misskey from 'misskey-js';
|
2019-04-29 00:11:57 +00:00
|
|
|
import XText from './page.text.vue';
|
|
|
|
import XSection from './page.section.vue';
|
|
|
|
import XImage from './page.image.vue';
|
2020-11-15 04:42:04 +00:00
|
|
|
import XNote from './page.note.vue';
|
2019-04-29 00:11:57 +00:00
|
|
|
|
2023-05-30 08:37:38 +00:00
|
|
|
function getComponent(type: string) {
|
|
|
|
switch (type) {
|
|
|
|
case 'text': return XText;
|
|
|
|
case 'section': return XSection;
|
|
|
|
case 'image': return XImage;
|
|
|
|
case 'note': return XNote;
|
|
|
|
default: return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-14 01:50:21 +00:00
|
|
|
defineProps<{
|
2024-01-30 10:53:53 +00:00
|
|
|
block: Misskey.entities.PageBlock,
|
2023-05-14 01:50:21 +00:00
|
|
|
h: number,
|
|
|
|
page: Misskey.entities.Page,
|
|
|
|
}>();
|
2019-04-29 00:11:57 +00:00
|
|
|
</script>
|