push
This commit is contained in:
25
lib/saas/store/modules/keepAlive.ts
Normal file
25
lib/saas/store/modules/keepAlive.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
import { defineStore } from 'pinia';
|
||||
export const useKeepAlive = defineStore({
|
||||
id: 'keepAlive',
|
||||
state() {
|
||||
return { keepAlive: [] };
|
||||
},
|
||||
getters: {
|
||||
getKeepAlive: (state: any) => state.keepAlive,
|
||||
},
|
||||
actions: {
|
||||
clearKeepAlive() {
|
||||
this.keepAlive = [];
|
||||
},
|
||||
removeKeepAlive(index: number) {
|
||||
this.keepAlive.splice(index, 1);
|
||||
},
|
||||
addKeepAlive(val: String) {
|
||||
if (val && this.keepAlive.findIndex((x) => x === val) === -1) {
|
||||
this.keepAlive.push(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user