mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
init
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
export interface DesignStateType {
|
||||
//深色主题
|
||||
darkTheme: boolean;
|
||||
//系统风格
|
||||
appTheme: string;
|
||||
//系统内置风格
|
||||
appThemeList: string[];
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { store } from '@/store';
|
||||
import designSetting from '@/settings/designSetting';
|
||||
const { darkTheme, appTheme, appThemeList } = designSetting;
|
||||
import { DesignStateType } from './designStore.d'
|
||||
|
||||
export const useDesignStore = defineStore({
|
||||
id: 'useDesignStore',
|
||||
state: (): DesignStateType => ({
|
||||
darkTheme,
|
||||
appTheme,
|
||||
appThemeList,
|
||||
}),
|
||||
getters: {
|
||||
getDarkTheme(): boolean {
|
||||
return this.darkTheme;
|
||||
},
|
||||
getAppTheme(): string {
|
||||
return this.appTheme;
|
||||
},
|
||||
getAppThemeList(): string[] {
|
||||
return this.appThemeList;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export function useDesignSettingWithOut() {
|
||||
return useDesignStore(store);
|
||||
}
|
||||
Reference in New Issue
Block a user