mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-09 13:53:38 +08:00
perf: view page add name
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import defaultSettings from "../../settings";
|
||||
import { defineStore } from "pinia";
|
||||
import { store } from "/@/store";
|
||||
import defaultSettings from "../../settings"
|
||||
import { defineStore } from "pinia"
|
||||
import { store } from "/@/store"
|
||||
|
||||
interface SettingState {
|
||||
title: string;
|
||||
fixedHeader: boolean;
|
||||
cachedPageList: string[];
|
||||
title: string
|
||||
fixedHeader: boolean
|
||||
cachedPageList: string[]
|
||||
}
|
||||
|
||||
export const useSettingStore = defineStore({
|
||||
@@ -14,29 +14,29 @@ export const useSettingStore = defineStore({
|
||||
title: defaultSettings.title,
|
||||
fixedHeader: defaultSettings.fixedHeader,
|
||||
// 需要开启keepalive的页面数组,里面放页面的name即可
|
||||
cachedPageList: ["editor"]
|
||||
cachedPageList: ["welcome", "reEditor"]
|
||||
}),
|
||||
getters: {
|
||||
getTitle() {
|
||||
return this.title;
|
||||
return this.title
|
||||
},
|
||||
getFixedHeader() {
|
||||
return this.fixedHeader;
|
||||
return this.fixedHeader
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
CHANGE_SETTING({ key, value }) {
|
||||
// eslint-disable-next-line no-prototype-builtins
|
||||
if (this.hasOwnProperty(key)) {
|
||||
this[key] = value;
|
||||
this[key] = value
|
||||
}
|
||||
},
|
||||
changeSetting(data) {
|
||||
this.CHANGE_SETTING(data);
|
||||
this.CHANGE_SETTING(data)
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
export function useSettingStoreHook() {
|
||||
return useSettingStore(store);
|
||||
return useSettingStore(store)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user