ruoyi-plus-soybean/src/App.vue

41 lines
978 B
Vue
Raw Normal View History

<script setup lang="ts">
2023-11-17 08:45:00 +08:00
import { computed } from 'vue';
import { NConfigProvider, darkTheme } from 'naive-ui';
import { useAppStore } from './store/modules/app';
import { useThemeStore } from './store/modules/theme';
import { naiveLocales, naiveDateLocales } from './locales/naive';
defineOptions({
name: 'App'
});
const appStore = useAppStore();
const themeStore = useThemeStore();
2023-11-17 08:45:00 +08:00
const naiveDarkTheme = computed(() => (themeStore.darkMode ? darkTheme : undefined));
2023-11-17 08:45:00 +08:00
const naiveLocale = computed(() => {
return naiveLocales[appStore.locale];
});
const naiveDateLocale = computed(() => {
return naiveDateLocales[appStore.locale];
});
</script>
2023-11-17 08:45:00 +08:00
<template>
<NConfigProvider
:theme="naiveDarkTheme"
:theme-overrides="themeStore.naiveTheme"
:locale="naiveLocale"
:date-locale="naiveDateLocale"
class="h-full"
>
<AppProvider>
<RouterView class="bg-layout" />
</AppProvider>
</NConfigProvider>
</template>
<style scoped></style>