Convert other pages to composition API

This commit is contained in:
2022-02-14 22:24:42 +00:00
parent d11c0036b5
commit 0a030eaee1
9 changed files with 196 additions and 231 deletions

View File

@@ -1,20 +1,25 @@
<script lang="ts">
import { mapState } from "pinia"
import { defineComponent } from "vue"
<script lang="ts" setup>
import Currency from "../components/Currency.vue"
import { useBudgetsStore } from "../stores/budget"
import { useAccountStore } from "../stores/budget-account"
import { useSettingsStore } from "../stores/settings"
export default defineComponent({
props: ["budgetid", "accountid"],
components: { Currency },
computed: {
...mapState(useSettingsStore, ["ExpandMenu"]),
...mapState(useBudgetsStore, ["CurrentBudgetName", "CurrentBudgetID"]),
...mapState(useAccountStore, ["OnBudgetAccounts", "OnBudgetAccountsBalance", "OffBudgetAccounts", "OffBudgetAccountsBalance"])
}
})
const props = defineProps<{
budgetid: string,
accountid: string,
}>();
const ExpandMenu = useSettingsStore().Menu.Expand;
const budgetStore = useBudgetsStore();
const CurrentBudgetName = budgetStore.CurrentBudgetName;
const CurrentBudgetID = budgetStore.CurrentBudgetID;
const accountStore = useAccountStore();
const OnBudgetAccounts = accountStore.OnBudgetAccounts;
const OffBudgetAccounts = accountStore.OffBudgetAccounts;
const OnBudgetAccountsBalance = accountStore.OnBudgetAccountsBalance;
const OffBudgetAccountsBalance = accountStore.OffBudgetAccountsBalance;
</script>
<template>