it-tools/src/App.vue

45 lines
1.1 KiB
Vue
Raw Normal View History

2022-03-31 00:33:29 +02:00
<script setup lang="ts">
import { layouts } from './layouts';
import { computed } from 'vue';
2022-04-22 23:31:40 +02:00
import { useRoute, RouterView } from 'vue-router';
import { darkThemeOverrides, lightThemeOverrides } from './themes';
import { darkTheme, NGlobalStyle, NMessageProvider } from 'naive-ui';
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));
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">
2022-03-31 00:33:29 +02:00
<n-global-style />
2022-04-04 00:24:45 +02:00
<n-message-provider placement="bottom">
2022-04-14 23:30:06 +02:00
<component :is="layout">
<router-view />
</component>
2022-04-04 00:24:45 +02:00
</n-message-provider>
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>