initHeader

This commit is contained in:
2024-08-22 11:27:06 +08:00
parent fe895bd37c
commit e0aaa7a30d
178 changed files with 5726 additions and 4999 deletions

View File

@@ -0,0 +1,24 @@
import {defineStore} from "pinia";
import {KeepAliveState} from "@/stores/interface";
import {KEEP_ALIVE_STORE_KEY} from '@/stores/constant'
export const useKeepAliveStore = defineStore({
id: KEEP_ALIVE_STORE_KEY,
state: (): KeepAliveState => ({
keepAliveName: []
}),
actions: {
// Add KeepAliveName
async addKeepAliveName(name: string) {
!this.keepAliveName.includes(name) && this.keepAliveName.push(name);
},
// Remove KeepAliveName
async removeKeepAliveName(name: string) {
this.keepAliveName = this.keepAliveName.filter(item => item !== name);
},
// Set KeepAliveName
async setKeepAliveName(keepAliveName: string[] = []) {
this.keepAliveName = keepAliveName;
}
}
});