You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
874 B
30 lines
874 B
|
7 months ago
|
<template>
|
||
|
|
<el-config-provider :locale="appStore.locale" :size="appStore.size">
|
||
|
|
<router-view />
|
||
|
|
</el-config-provider>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script setup lang="ts">
|
||
|
|
import { useSettingsStore } from '@/store/modules/settings';
|
||
|
|
import { handleThemeStyle } from '@/utils/theme';
|
||
|
|
import { useAppStore } from '@/store/modules/app';
|
||
|
|
|
||
|
|
const appStore = useAppStore();
|
||
|
|
|
||
|
|
// 修复 useDarkKey 为 auto 时跟随系统主题导致强制暗黑的问题
|
||
|
|
// const darkKey = localStorage.getItem('useDarkKey');
|
||
|
|
// if (darkKey !== 'dark' && darkKey !== 'light') {
|
||
|
|
// localStorage.setItem('useDarkKey', 'light');
|
||
|
|
// document.documentElement.classList.remove('dark');
|
||
|
|
// document.documentElement.setAttribute('data-theme', 'light');
|
||
|
|
// }
|
||
|
|
|
||
|
|
onMounted(() => {
|
||
|
|
nextTick(() => {
|
||
|
|
// 初始化主题样式
|
||
|
|
//debugger
|
||
|
|
handleThemeStyle(useSettingsStore().theme);
|
||
|
|
});
|
||
|
|
});
|
||
|
|
</script>
|