Convert NewBudget and TransactionRow

This commit is contained in:
Jan Bader 2022-02-15 08:04:25 +00:00
parent 1a79177422
commit d28c894d21
2 changed files with 20 additions and 29 deletions

View File

@ -1,16 +1,16 @@
<script lang="ts">
<script lang="ts" setup>
import { mapState } from "pinia";
import { defineComponent } from "vue";
import { computed, defineComponent } from "vue";
import { useBudgetsStore } from "../stores/budget";
import { Transaction } from "../stores/budget-account";
import Currency from "./Currency.vue";
export default defineComponent({
props: [ "transaction", "index" ],
components: { Currency },
computed: {
...mapState(useBudgetsStore, ["CurrentBudgetID"])
}
})
const props = defineProps<{
transaction: Transaction,
index: number,
}>();
const CurrentBudgetID = computed(()=> useBudgetsStore().CurrentBudgetID);
</script>
<template>

View File

@ -1,26 +1,17 @@
<script lang="ts">
<script lang="ts" setup>
import Card from '../components/Card.vue';
import { defineComponent } from "vue";
import { ref } from "vue";
import { useBudgetsStore } from '../stores/budget';
export default defineComponent({
data() {
return {
dialog: false,
budgetName: ""
}
},
components: { Card },
methods: {
saveBudget() {
useBudgetsStore().NewBudget(this.$data.budgetName);
this.$data.dialog = false;
},
newBudget() {
this.$data.dialog = true;
}
}
})
const dialog = ref(false);
const budgetName = ref("");
function saveBudget() {
useBudgetsStore().NewBudget(budgetName.value);
dialog.value = false;
};
function newBudget() {
dialog.value = true;
};
</script>
<template>