Implement basic routing

This commit is contained in:
2022-01-18 13:29:51 +00:00
parent 2112192670
commit d0e52ddfa6
8 changed files with 67 additions and 17 deletions

View File

@ -0,0 +1,34 @@
<script setup>
let dashboard;
fetch("/dashboard")
.then(x => x.json())
.then(x => console.log(x))
.then(x => dashboard = x);
</script>
<!--
{{define "title"}}
Budgets
{{end}}
{{define "new"}}
{{template "budget-new"}}
{{end}}
{{define "sidebar"}}
Please select a budget.
{{end}}
{{template "base" .}}
-->
<template>
<div v-if="dashboard != nil" v-for="budget in dashboard.Budgets" class="budget-item">
<a href="budget/{{budget.ID}}">{{budget.Name}}</a>
<span class="time"></span>
</div>
<div class="budget-item">
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#newbudgetmodal">New Budget</button>
<span class="time"></span>
</div>
</template>