diff --git a/public/serverConfig.json b/public/serverConfig.json index 4c2b24090..a7353fa56 100644 --- a/public/serverConfig.json +++ b/public/serverConfig.json @@ -3,6 +3,7 @@ "Title": "PureAdmin", "FixedHeader": true, "HiddenSideBar": false, + "MultiTabsCache": false, "KeepAlive": true, "Locale": "zh", "Layout": "vertical", diff --git a/src/store/modules/multiTabs.ts b/src/store/modules/multiTabs.ts new file mode 100644 index 000000000..6c106e67e --- /dev/null +++ b/src/store/modules/multiTabs.ts @@ -0,0 +1,20 @@ +import { defineStore } from "pinia"; +import { store } from "/@/store"; +import { getConfig } from "/@/config"; + +export const useMultiTabsStore = defineStore({ + id: "pure-multiTabs", + state: () => ({ + multiTabsCache: getConfig().MultiTabsCache + }), + getters: { + getMultiTabsCache() { + return this.multiTabsCache; + } + }, + actions: {} +}); + +export function useMultiTabsStoreHook() { + return useMultiTabsStore(store); +} diff --git a/types/global.d.ts b/types/global.d.ts index 8f5b26c16..c7f52b2e3 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -87,6 +87,7 @@ declare global { Title?: string; FixedHeader?: boolean; HiddenSideBar?: boolean; + MultiTabsCache?: boolean; KeepAlive?: boolean; Locale?: string; Layout?: string;