mirror of
https://github.com/paricafe/misskey.git
synced 2024-12-04 20:56:44 -06:00
837a8e15d8
* refactor(frontend): shouldCollapsedを共通化 * refactor(frontend): config.js, worker-multi-dispatch.js, intl-const.jsを共通化 * fix(frontend-shared): fix type error * refactor(frontend): is-link.jsと、同一の振る舞いをする記述を共通化 * fix * fix lint * lint fixes
49 lines
1.2 KiB
Vue
49 lines
1.2 KiB
Vue
<!--
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
-->
|
|
|
|
<template>
|
|
<div :class="$style.root">
|
|
<div style="container-type: inline-size;">
|
|
<RouterView/>
|
|
</div>
|
|
|
|
<XCommon/>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { computed, provide, ref } from 'vue';
|
|
import XCommon from './_common_/common.vue';
|
|
import { PageMetadata, provideMetadataReceiver, provideReactiveMetadata } from '@/scripts/page-metadata.js';
|
|
import { instanceName } from '@@/js/config.js';
|
|
import { mainRouter } from '@/router/main.js';
|
|
|
|
const isRoot = computed(() => mainRouter.currentRoute.value.name === 'index');
|
|
|
|
const pageMetadata = ref<null | PageMetadata>(null);
|
|
|
|
provide('router', mainRouter);
|
|
provideMetadataReceiver((metadataGetter) => {
|
|
const info = metadataGetter();
|
|
pageMetadata.value = info;
|
|
if (pageMetadata.value) {
|
|
if (isRoot.value && pageMetadata.value.title === instanceName) {
|
|
document.title = pageMetadata.value.title;
|
|
} else {
|
|
document.title = `${pageMetadata.value.title} | ${instanceName}`;
|
|
}
|
|
}
|
|
});
|
|
provideReactiveMetadata(pageMetadata);
|
|
|
|
document.documentElement.style.overflowY = 'scroll';
|
|
</script>
|
|
|
|
<style lang="scss" module>
|
|
.root {
|
|
min-height: 100dvh;
|
|
box-sizing: border-box;
|
|
}
|
|
</style>
|