feat: 初始化仓库

This commit is contained in:
2025-02-10 20:21:23 +08:00
commit a5f04356ee
225 changed files with 24988 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
import { defineStore } from "pinia";
import { type setType, store, getConfig } from "../utils";
export const useSettingStore = defineStore({
id: "setting",
state: (): setType => ({
title: getConfig().Title,
fixedHeader: getConfig().FixedHeader,
hiddenSideBar: getConfig().HiddenSideBar
}),
getters: {
getTitle(state) {
return state.title;
},
getFixedHeader(state) {
return state.fixedHeader;
},
getHiddenSideBar(state) {
return state.hiddenSideBar;
}
},
actions: {
CHANGE_SETTING({ key, value }) {
if (Reflect.has(this, key)) {
this[key] = value;
}
},
changeSetting(data) {
this.CHANGE_SETTING(data);
}
}
});
export function useSettingStoreHook() {
return useSettingStore(store);
}