mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-12-14 22:30:31 +08:00
perf: 同步完整版分支代码
This commit is contained in:
25
src/store/modules/epTheme.ts
Normal file
25
src/store/modules/epTheme.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { store } from "/@/store";
|
||||
import { defineStore } from "pinia";
|
||||
import { storageLocal } from "/@/utils/storage";
|
||||
|
||||
export const useEpThemeStore = defineStore({
|
||||
id: "pure-epTheme",
|
||||
state: () => ({
|
||||
epThemeColor: storageLocal.getItem("epThemeColor") || "#409EFF"
|
||||
}),
|
||||
getters: {
|
||||
getEpThemeColor() {
|
||||
return this.epThemeColor;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
setEpThemeColor(newColor) {
|
||||
this.epThemeColor = newColor;
|
||||
storageLocal.setItem("epThemeColor", newColor);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export function useEpThemeStoreHook() {
|
||||
return useEpThemeStore(store);
|
||||
}
|
||||
Reference in New Issue
Block a user