2022-03-31 00:33:29 +02:00
|
|
|
<script setup lang="ts">
|
2023-05-28 23:13:24 +02:00
|
|
|
import { RouterView, useRoute } from 'vue-router';
|
|
|
|
import { NGlobalStyle, NMessageProvider, NNotificationProvider, darkTheme } from 'naive-ui';
|
2022-08-04 22:46:50 +02:00
|
|
|
import { darkThemeOverrides, lightThemeOverrides } from './themes';
|
|
|
|
import { layouts } from './layouts';
|
2022-04-04 01:52:59 +02:00
|
|
|
import { useStyleStore } from './stores/style.store';
|
2022-03-31 00:33:29 +02:00
|
|
|
|
|
|
|
const route = useRoute();
|
2022-04-22 23:31:40 +02:00
|
|
|
const layout = computed(() => route?.meta?.layout ?? layouts.base);
|
|
|
|
const styleStore = useStyleStore();
|
2022-04-04 01:52:59 +02:00
|
|
|
|
2022-04-22 23:31:40 +02:00
|
|
|
const theme = computed(() => (styleStore.isDarkTheme ? darkTheme : null));
|
|
|
|
const themeOverrides = computed(() => (styleStore.isDarkTheme ? darkThemeOverrides : lightThemeOverrides));
|
2023-11-01 15:38:19 +01:00
|
|
|
|
|
|
|
const { locale } = useI18n();
|
|
|
|
|
|
|
|
syncRef(
|
|
|
|
locale,
|
|
|
|
useStorage('locale', locale),
|
|
|
|
);
|
2022-03-31 00:33:29 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2022-04-22 23:31:40 +02:00
|
|
|
<n-config-provider :theme="theme" :theme-overrides="themeOverrides">
|
2023-05-28 23:13:24 +02:00
|
|
|
<NGlobalStyle />
|
|
|
|
<NMessageProvider placement="bottom">
|
|
|
|
<NNotificationProvider placement="bottom-right">
|
2023-03-01 21:46:23 +01:00
|
|
|
<component :is="layout">
|
2023-05-28 23:13:24 +02:00
|
|
|
<RouterView />
|
2023-03-01 21:46:23 +01:00
|
|
|
</component>
|
2023-05-28 23:13:24 +02:00
|
|
|
</NNotificationProvider>
|
|
|
|
</NMessageProvider>
|
2022-03-31 00:33:29 +02:00
|
|
|
</n-config-provider>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
body {
|
|
|
|
min-height: 100%;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
}
|
2022-04-12 13:24:14 +02:00
|
|
|
|
2022-03-31 00:33:29 +02:00
|
|
|
html {
|
|
|
|
height: 100%;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
}
|
2022-04-12 13:24:14 +02:00
|
|
|
|
2022-03-31 00:33:29 +02:00
|
|
|
* {
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
2022-04-22 23:31:40 +02:00
|
|
|
</style>
|