From 6f48226d52bf487110133a6cbef727ceef2799a6 Mon Sep 17 00:00:00 2001 From: Jens Christian Aanestad <jenscaa@stud.ntnu.no> Date: Mon, 29 Apr 2024 13:29:25 +0200 Subject: [PATCH] feat/Created new pinia store for budget --- src/stores/BudgetStore.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/stores/BudgetStore.ts diff --git a/src/stores/BudgetStore.ts b/src/stores/BudgetStore.ts new file mode 100644 index 0000000..0e6fce4 --- /dev/null +++ b/src/stores/BudgetStore.ts @@ -0,0 +1,20 @@ +import { defineStore } from 'pinia' + +export const useBudgetStore = defineStore('BudgetStore', { + state: () => ({ + activeBudgetId: 0, + }), + actions: { + setActiveBudgetId(id: number) { + this.activeBudgetId = id + } + }, + getters: { + getActiveBudgetId(): number { + return this.activeBudgetId + } + }, + persist: { + storage: sessionStorage + } +}); -- GitLab