starting show category

mic_level
Matt Huntington 3 years ago
parent 30f0632216
commit ae6286852f

@ -1,6 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import Summary from './components/summary.vue' import Summary from './components/summary.vue'
import MinsLeftToPracticeToday from './components/mins_left_to_practice_today.vue' import MinsLeftToPracticeToday from './components/mins_left_to_practice_today.vue'
import ShowCategory from './components/show_category.vue'
</script> </script>
<template> <template>
@ -10,6 +11,7 @@
<main> <main>
<MinsLeftToPracticeToday/> <MinsLeftToPracticeToday/>
<Summary/> <Summary/>
<ShowCategory/>
</main> </main>
</template> </template>

@ -0,0 +1,34 @@
<script lang="ts">
import axios from 'axios';
export default {
data() {
return {
categories:[]
}
},
mounted() {
axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'categories').then((response)=>{
this.categories = response.data
})
}
}
</script>
<template>
<h2>Show Category</h2>
<select>
<option v-for="category in categories" v-bind:value="category.id">
{{category.instrument}}
:
{{category.category}}
</option>
</select>
</template>
<style scoped>
td {
border:1px solid black;
padding:1em;
}
</style>
Loading…
Cancel
Save