updated InfoModal.vue + infoState.ts

This commit is contained in:
2022-03-25 20:32:57 +01:00
parent ce70fa2e6f
commit 552188c8a9
2 changed files with 28 additions and 26 deletions

View File

@@ -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: {},