mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-09-29 14:46:41 +08:00
fix(projects): fixed issue that themeStore was not reset to the initial settings when resetting it.
This commit is contained in:
parent
071241f8cb
commit
35de124efb
@ -5,6 +5,7 @@ import { useEventListener, usePreferredColorScheme } from '@vueuse/core';
|
||||
import { getPaletteColorByNumber } from '@sa/color';
|
||||
import { SetupStoreId } from '@/enum';
|
||||
import { localStg } from '@/utils/storage';
|
||||
import { themeSettings } from '@/theme/settings';
|
||||
import {
|
||||
addThemeVarsToHtml,
|
||||
createThemeToken,
|
||||
@ -57,8 +58,8 @@ export const useThemeStore = defineStore(SetupStoreId.Theme, () => {
|
||||
/** Reset store */
|
||||
function resetStore() {
|
||||
const themeStore = useThemeStore();
|
||||
|
||||
themeStore.$reset();
|
||||
const reset = themeStore.$reset as (arg?: Partial<typeof themeSettings>) => void;
|
||||
reset(themeSettings);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -15,8 +15,8 @@ export function resetSetupStore(context: PiniaPluginContext) {
|
||||
|
||||
const defaultStore = cloneDeep($state);
|
||||
|
||||
context.store.$reset = () => {
|
||||
context.store.$patch(defaultStore);
|
||||
context.store.$reset = (state?: Partial<typeof defaultStore>) => {
|
||||
context.store.$patch(state || defaultStore);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user