2021-12-10 14:11:49 +08:00
|
|
|
<template>
|
|
|
|
<NConfigProvider
|
|
|
|
:locale="zhCN"
|
|
|
|
:theme="getDarkTheme"
|
|
|
|
:theme-overrides="getThemeOverrides"
|
|
|
|
:date-locale="dateZhCN"
|
|
|
|
>
|
|
|
|
<AppProvider>
|
|
|
|
<router-view />
|
|
|
|
</AppProvider>
|
|
|
|
</NConfigProvider>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { computed } from 'vue'
|
|
|
|
import { zhCN, dateZhCN, darkTheme, GlobalThemeOverrides } from 'naive-ui'
|
|
|
|
import { AppProvider } from '@/components/Application'
|
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
import { useDesignStore } from '@/store/modules/designStore/designStore'
|
|
|
|
|
|
|
|
const route = useRoute()
|
|
|
|
const designStore = useDesignStore()
|
|
|
|
|
|
|
|
const getThemeOverrides = computed(
|
|
|
|
(): GlobalThemeOverrides => {
|
|
|
|
return {
|
|
|
|
common: {
|
|
|
|
primaryColor: designStore.appTheme
|
|
|
|
},
|
|
|
|
LoadingBar: {
|
|
|
|
colorLoading: designStore.appTheme
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2021-12-14 15:53:30 +08:00
|
|
|
const getDarkTheme = computed(() =>
|
|
|
|
designStore.darkTheme ? darkTheme : undefined
|
|
|
|
)
|
2021-12-10 14:11:49 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss"></style>
|