-
Notifications
You must be signed in to change notification settings - Fork 5.7k
/
App.vue
52 lines (49 loc) · 1.76 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<template>
<StyleProvider hash-priority="high" :transformers="[legacyLogicalPropertiesTransformer]">
<ConfigProvider :locale="getAntdLocale" :theme="getTheme">
<AppProvider prefixCls="jeesite">
<RouterView />
</AppProvider>
</ConfigProvider>
</StyleProvider>
</template>
<script lang="ts" setup>
import { computed, unref } from 'vue';
import {
StyleProvider,
legacyLogicalPropertiesTransformer,
ConfigProvider,
theme,
} from 'ant-design-vue';
import { AppProvider } from '/@/components/Application';
import { useRootSetting } from '/@/hooks/setting/useRootSetting';
import { ThemeEnum } from '/@/enums/appEnum';
import { useLocale } from '/@/locales/useLocale';
import { useTitle } from '/@/hooks/web/useTitle';
import { darkPrimaryColor } from '../build/theme/themeConfig';
import 'dayjs/locale/zh-cn';
// support Multi-language
const { getAntdLocale } = useLocale();
const { getDarkMode, getThemeColor } = useRootSetting();
const getTheme = computed(() => {
const isDark = unref(getDarkMode) === ThemeEnum.DARK;
return {
algorithm: isDark ? theme.darkAlgorithm : theme.defaultAlgorithm,
token: {
colorPrimary: isDark ? darkPrimaryColor : unref(getThemeColor),
colorLink: isDark ? darkPrimaryColor : unref(getThemeColor),
colorInfo: isDark ? darkPrimaryColor : unref(getThemeColor),
},
};
});
// Listening to page changes and dynamically changing site titles
useTitle();
</script>
<style lang="less">
body {
line-height: 1.5715;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji';
}
</style>