2019-04-29 03:11:57 +03:00
|
|
|
<template>
|
2023-05-30 11:37:38 +03:00
|
|
|
<component :is="getComponent(block.type)" :key="block.id" :page="page" :block="block" :h="h"/>
|
2019-04-29 03:11:57 +03:00
|
|
|
</template>
|
|
|
|
|
2023-05-14 04:50:21 +03:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
|
|
|
import * as Misskey from 'misskey-js';
|
2019-04-29 03:11:57 +03:00
|
|
|
import XText from './page.text.vue';
|
|
|
|
import XSection from './page.section.vue';
|
|
|
|
import XImage from './page.image.vue';
|
2020-11-15 06:42:04 +02:00
|
|
|
import XNote from './page.note.vue';
|
2023-05-14 04:50:21 +03:00
|
|
|
import { Block } from './block.type';
|
2019-04-29 03:11:57 +03:00
|
|
|
|
2023-05-30 11:37:38 +03: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 04:50:21 +03:00
|
|
|
defineProps<{
|
|
|
|
block: Block,
|
|
|
|
h: number,
|
|
|
|
page: Misskey.entities.Page,
|
|
|
|
}>();
|
2019-04-29 03:11:57 +03:00
|
|
|
</script>
|