style: 使用默认布局设置
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { computed, effectScope, onScopeDispose, ref, toRefs, watch } from 'vue';
|
||||
import type { Ref } from 'vue';
|
||||
import { defineStore } from 'pinia';
|
||||
import { useEventListener, usePreferredColorScheme } from '@vueuse/core';
|
||||
import { usePreferredColorScheme } from '@vueuse/core';
|
||||
import { SetupStoreId } from '@/enum';
|
||||
import { localStg } from '@/utils/storage';
|
||||
import { addThemeVarsToHtml, createThemeToken, getAntdTheme, initThemeSettings, toggleCssDarkMode } from './shared';
|
||||
@@ -102,18 +102,18 @@ export const useThemeStore = defineStore(SetupStoreId.Theme, () => {
|
||||
}
|
||||
|
||||
/** Cache theme settings */
|
||||
function cacheThemeSettings() {
|
||||
const isProd = import.meta.env.PROD;
|
||||
|
||||
if (!isProd) return;
|
||||
|
||||
localStg.set('themeSettings', settings.value);
|
||||
}
|
||||
|
||||
// cache theme settings when page is closed or refreshed
|
||||
useEventListener(window, 'beforeunload', () => {
|
||||
cacheThemeSettings();
|
||||
});
|
||||
// function cacheThemeSettings() {
|
||||
// const isProd = import.meta.env.PROD;
|
||||
//
|
||||
// if (!isProd) return;
|
||||
//
|
||||
// localStg.set('themeSettings', settings.value);
|
||||
// }
|
||||
//
|
||||
// // cache theme settings when page is closed or refreshed
|
||||
// useEventListener(window, 'beforeunload', () => {
|
||||
// cacheThemeSettings();
|
||||
// });
|
||||
|
||||
// watch store
|
||||
scope.run(() => {
|
||||
|
||||
@@ -10,6 +10,8 @@ const DARK_CLASS = 'dark';
|
||||
|
||||
/** Init theme settings */
|
||||
export function initThemeSettings() {
|
||||
return themeSettings; // 直接使用默认设置 src/store/modules/theme/index.ts 注释104行Cache theme settings相关
|
||||
|
||||
const isProd = import.meta.env.PROD;
|
||||
|
||||
// if it is development mode, the theme settings will not be cached, by update `themeSettings` in `src/theme/settings.ts` to update theme settings
|
||||
|
||||
Reference in New Issue
Block a user