|
|
@@ -12,50 +12,19 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { computed } from 'vue'
|
|
|
-import {
|
|
|
- zhCN,
|
|
|
- dateZhCN,
|
|
|
- darkTheme,
|
|
|
- NConfigProvider,
|
|
|
- GlobalThemeOverrides
|
|
|
-} from 'naive-ui'
|
|
|
+import { zhCN, dateZhCN, NConfigProvider } from 'naive-ui'
|
|
|
import { AppProvider } from '@/components/Application'
|
|
|
import { useDesignStore } from '@/store/modules/designStore/designStore'
|
|
|
-import { borderRadius } from '@/settings/designSetting'
|
|
|
+
|
|
|
+import { getDarkThemeHook, getThemeOverridesHook } from '@/hooks'
|
|
|
|
|
|
const designStore = useDesignStore()
|
|
|
|
|
|
// 返回暗黑主题
|
|
|
-const getDarkTheme = computed(() =>
|
|
|
- designStore.getDarkTheme ? darkTheme : undefined
|
|
|
-)
|
|
|
+const getDarkTheme = getDarkThemeHook()
|
|
|
|
|
|
// 主题配置
|
|
|
-const getThemeOverrides = computed(
|
|
|
- (): GlobalThemeOverrides => {
|
|
|
- const commonObj = {
|
|
|
- common: {
|
|
|
- borderRadius
|
|
|
- }
|
|
|
- }
|
|
|
- const lightObject = {
|
|
|
- common: {
|
|
|
- ...commonObj.common
|
|
|
- }
|
|
|
- }
|
|
|
- const dartObject = {
|
|
|
- common: {
|
|
|
- primaryColor: designStore.appTheme,
|
|
|
- ...commonObj.common
|
|
|
- },
|
|
|
- LoadingBar: {
|
|
|
- colorLoading: designStore.appTheme
|
|
|
- }
|
|
|
- }
|
|
|
- return designStore.getDarkTheme ? dartObject : lightObject
|
|
|
- }
|
|
|
-)
|
|
|
+const getThemeOverrides = getThemeOverridesHook()
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss"></style>
|