Use vue's Composition API in components #11

Merged
jacob1123 merged 9 commits from vue-composition into master 2022-02-15 10:13:47 +01:00
Showing only changes of commit 1a79177422 - Show all commits

View File

@ -1,4 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from "vue";
import Currency from "../components/Currency.vue" import Currency from "../components/Currency.vue"
import { useBudgetsStore } from "../stores/budget" import { useBudgetsStore } from "../stores/budget"
import { useAccountStore } from "../stores/budget-account" import { useAccountStore } from "../stores/budget-account"
@ -9,17 +10,17 @@ const props = defineProps<{
accountid: string, accountid: string,
}>(); }>();
const ExpandMenu = useSettingsStore().Menu.Expand; const ExpandMenu = computed(() => useSettingsStore().Menu.Expand);
const budgetStore = useBudgetsStore(); const budgetStore = useBudgetsStore();
const CurrentBudgetName = budgetStore.CurrentBudgetName; const CurrentBudgetName = computed(() => budgetStore.CurrentBudgetName);
const CurrentBudgetID = budgetStore.CurrentBudgetID; const CurrentBudgetID = computed(() => budgetStore.CurrentBudgetID);
const accountStore = useAccountStore(); const accountStore = useAccountStore();
const OnBudgetAccounts = accountStore.OnBudgetAccounts; const OnBudgetAccounts = computed(() => accountStore.OnBudgetAccounts);
const OffBudgetAccounts = accountStore.OffBudgetAccounts; const OffBudgetAccounts = computed(() => accountStore.OffBudgetAccounts);
const OnBudgetAccountsBalance = accountStore.OnBudgetAccountsBalance; const OnBudgetAccountsBalance = computed(() => accountStore.OnBudgetAccountsBalance);
const OffBudgetAccountsBalance = accountStore.OffBudgetAccountsBalance; const OffBudgetAccountsBalance = computed(() => accountStore.OffBudgetAccountsBalance);
</script> </script>
<template> <template>