Sharkey/packages/frontend/src/components/page/page.section.vue

50 lines
813 B
Vue
Raw Normal View History

<template>
2023-05-27 05:35:26 +03:00
<section>
<component
:is="'h' + h"
:class="{
'h2': h === 2,
'h3': h === 3,
'h4': h === 4,
}"
>
{{ block.title }}
</component>
2023-05-27 05:35:26 +03:00
<div class="_gaps">
2023-05-14 04:50:21 +03:00
<XBlock v-for="child in block.children" :key="child.id" :page="page" :block="child" :h="h + 1"/>
</div>
</section>
</template>
2023-05-14 04:50:21 +03:00
<script lang="ts" setup>
import { defineAsyncComponent } from 'vue';
import * as Misskey from 'misskey-js';
import { SectionBlock } from './block.type';
const XBlock = defineAsyncComponent(() => import('./page.block.vue'));
defineProps<{
block: SectionBlock,
h: number,
page: Misskey.entities.Page,
}>();
</script>
2023-05-27 05:35:26 +03:00
<style lang="scss" module>
.h2 {
font-size: 1.35em;
margin: 0 0 0.5em 0;
}
2023-05-27 05:35:26 +03:00
.h3 {
font-size: 1em;
margin: 0 0 0.5em 0;
}
2023-05-27 05:35:26 +03:00
.h4 {
font-size: 1em;
margin: 0 0 0.5em 0;
}
</style>