mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-25 05:50:18 +08:00
feat(projects): 1.0 beta
This commit is contained in:
54
src/App.vue
54
src/App.vue
@@ -1,26 +1,40 @@
|
||||
<template>
|
||||
<n-config-provider
|
||||
:theme="theme.naiveTheme"
|
||||
:theme-overrides="theme.naiveThemeOverrides"
|
||||
:locale="zhCN"
|
||||
:date-locale="dateZhCN"
|
||||
class="h-full"
|
||||
>
|
||||
<naive-provider>
|
||||
<router-view />
|
||||
</naive-provider>
|
||||
</n-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateZhCN, zhCN } from 'naive-ui';
|
||||
import { subscribeStore, useThemeStore } from '@/store';
|
||||
import { useGlobalEvents } from '@/composables';
|
||||
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';
|
||||
|
||||
const theme = useThemeStore();
|
||||
defineOptions({
|
||||
name: 'App'
|
||||
});
|
||||
|
||||
subscribeStore();
|
||||
useGlobalEvents();
|
||||
const appStore = useAppStore();
|
||||
const themeStore = useThemeStore();
|
||||
|
||||
const naiveDarkTheme = computed(() => (themeStore.darkMode ? darkTheme : undefined));
|
||||
|
||||
const naiveLocale = computed(() => {
|
||||
return naiveLocales[appStore.locale];
|
||||
});
|
||||
|
||||
const naiveDateLocale = computed(() => {
|
||||
return naiveDateLocales[appStore.locale];
|
||||
});
|
||||
</script>
|
||||
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user