stubbed out analysis pane
This commit is contained in:
@@ -5,5 +5,6 @@ export const AppState = reactive({
|
|||||||
user: {},
|
user: {},
|
||||||
account: {},
|
account: {},
|
||||||
transactions: [],
|
transactions: [],
|
||||||
categories: []
|
categories: [],
|
||||||
|
activeCategory: {}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<template>
|
||||||
|
<div class="component">
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
setup(){
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="`component flex justify-between mb-2 p-2 pr-0 bg-stone-800 hover:text-stone-900 ${totalSpent() > category.budgeted ? 'text-red-400 hover:bg-red-400' : 'hover:bg-green-300'}`">
|
<div @click="openCategory"
|
||||||
|
:class="`component flex justify-between mb-2 p-2 pr-0 bg-stone-800 hover:text-stone-900 ${totalSpent() > category.budgeted ? 'text-red-400 hover:bg-red-400' : 'hover:bg-green-300'}`">
|
||||||
<h3 class="text-2xl">{{category.name}}</h3>
|
<h3 class="text-2xl">{{category.name}}</h3>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<p class="w-16 px-2 border-l-2 border-stone-900">${{totalSpent()}}</p>
|
<p class="w-16 px-2 border-l-2 border-stone-900">${{totalSpent()}}</p>
|
||||||
|
<!-- TODO turn this into an input field for editing -->
|
||||||
<p class="w-16 px-2 border-l-2 border-stone-900">${{category.budgeted}}</p>
|
<p class="w-16 px-2 border-l-2 border-stone-900">${{category.budgeted}}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -11,6 +13,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { computed, reactive, onMounted, ref, watchEffect } from "vue";
|
import { computed, reactive, onMounted, ref, watchEffect } from "vue";
|
||||||
|
import { AppState } from "../AppState";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -30,6 +33,9 @@ export default {
|
|||||||
total += props.category.transactions[t].amount
|
total += props.category.transactions[t].amount
|
||||||
}
|
}
|
||||||
return total
|
return total
|
||||||
|
},
|
||||||
|
openCategory() {
|
||||||
|
AppState.activeCategory = props.category
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user