mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-09 13:53:38 +08:00
feat: ep theme (#156)
* feat: ep-theme * perf: ep-theme Co-authored-by: lrl <742798240@qq.com>
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