import { IStyleConfig } from '@/services/customize/styleConfig.datatype';
import { StyleConfig } from '@/services/customize/styleConfig.model';
import { defineStore } from 'pinia';
const useThemeStore = defineStore('theme', {
state: () => {
return new StyleConfig().getStyleConfig;
},
getters: {},
actions: {
setThemeState(payload: { type: string; value: any }) {
this[payload.type] = payload.value;
},
initThemeState(data: IStyleConfig): void {
this.brandElement = { ...this.brandElement, ...data.brandElement };
this.loginPage = { ...this.loginPage, ...data.loginPage };
this.colorConfig = { ...this.colorConfig, ...data.colorConfig };
this.layoutConfig = { ...this.layoutConfig, ...data.layoutConfig };
this.textStyleConfig = { ...this.textStyleConfig, ...data.textStyleConfig };
this.compStyleConfig = { ...this.compStyleConfig, ...data.compStyleConfig };
}
}
});
export default useThemeStore;