refactor: tabs

This commit is contained in:
xiaoxian521 2021-11-25 21:30:44 +08:00
parent d79e63f673
commit aca6a667f3
3 changed files with 22 additions and 0 deletions

View File

@ -3,6 +3,7 @@
"Title": "PureAdmin",
"FixedHeader": true,
"HiddenSideBar": false,
"MultiTabsCache": false,
"KeepAlive": true,
"Locale": "zh",
"Layout": "vertical",

View File

@ -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);
}

1
types/global.d.ts vendored
View File

@ -87,6 +87,7 @@ declare global {
Title?: string;
FixedHeader?: boolean;
HiddenSideBar?: boolean;
MultiTabsCache?: boolean;
KeepAlive?: boolean;
Locale?: string;
Layout?: string;