forked from CSGOWTF/csgowtf
updated InfoModal.vue + infoState.ts
This commit is contained in:
@@ -8,6 +8,7 @@ export type infoState = {
|
||||
|
||||
export type RootState = {
|
||||
infoState: infoState[];
|
||||
infoCount: number;
|
||||
};
|
||||
|
||||
export const useInfoStateStore = defineStore({
|
||||
@@ -15,13 +16,16 @@ export const useInfoStateStore = defineStore({
|
||||
state: () =>
|
||||
({
|
||||
infoState: [],
|
||||
infoCount: 0,
|
||||
} as RootState),
|
||||
actions: {
|
||||
addInfo(payload: infoState) {
|
||||
this.infoState.push(payload);
|
||||
this.infoCount += 1;
|
||||
},
|
||||
removeInfo(id: number) {
|
||||
this.infoState.splice(id, 1);
|
||||
this.infoCount -= 1;
|
||||
},
|
||||
},
|
||||
getters: {},
|
||||
|
||||
Reference in New Issue
Block a user