firefish/packages/client/src/ui/zen.vue

41 lines
1 KiB
Vue
Raw Normal View History

2023-07-20 04:17:05 +09:00
<template>
<div class="mk-app">
<RouterView />
<XCommon />
</div>
</template>
<script lang="ts" setup>
import type { ComputedRef } from "vue";
2023-08-25 07:19:12 +09:00
import { provide, ref } from "vue";
2023-07-20 04:17:05 +09:00
import XCommon from "./_common_/common.vue";
import { mainRouter } from "@/router";
import type { PageMetadata } from "@/scripts/page-metadata";
import {
provideMetadataReceiver,
setPageMetadata,
} from "@/scripts/page-metadata";
import { instanceName } from "@/config";
2023-09-04 17:47:24 +09:00
const pageMetadata = ref<null | ComputedRef<PageMetadata>>();
2023-07-20 04:17:05 +09:00
provide("router", mainRouter);
provideMetadataReceiver((info) => {
2023-08-25 07:19:12 +09:00
pageMetadata.value = info;
if (pageMetadata.value.value) {
document.title = `${pageMetadata.value.value.title} | ${instanceName}`;
2023-07-20 04:17:05 +09:00
}
});
document.documentElement.style.overflowY = "scroll";
</script>
<style lang="scss" scoped>
.mk-app {
// ほんとは単に 100vh と書きたいところだが... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
min-height: calc(var(--vh, 1vh) * 100);
box-sizing: border-box;
}
</style>