Implement basic routing
This commit is contained in:
34
web/src/pages/Dashboard.vue
Normal file
34
web/src/pages/Dashboard.vue
Normal 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>
|
Reference in New Issue
Block a user