diff --git a/frontend/components/displayIncomeAndExpenditure.vue b/frontend/components/displayIncomeAndExpenditure.vue index d8227b6..cd3364a 100644 --- a/frontend/components/displayIncomeAndExpenditure.vue +++ b/frontend/components/displayIncomeAndExpenditure.vue @@ -5,7 +5,15 @@ import { Line } from "vue-chartjs"; dayjs.extend(customParseFormat) +const props = defineProps({ + headerTarget: { + type: String, + default: "" + } +}) + const tempStore = useTempStore() +const isMounted = ref(false) const amountMode = ref("net") const granularity = ref("year") @@ -218,12 +226,65 @@ const chartOptions = ref({ maintainAspectRatio: false, }) +const showHeaderControls = computed(() => isMounted.value && !!props.headerTarget) +const showInlineControls = computed(() => !showHeaderControls.value) + +onMounted(() => { + isMounted.value = true +}) + loadData()