From b7690e12657888a8a4106097444474f72019baf6 Mon Sep 17 00:00:00 2001 From: Matthew Huntington Date: Sun, 1 Sep 2024 21:52:22 -0400 Subject: [PATCH] using v-model for show category --- src/App.vue | 17 +++++++++++------ src/components/category_chooser.vue | 21 +++++++++------------ src/components/show_category.vue | 27 ++++++++++----------------- src/components/summary.vue | 11 ++++++----- 4 files changed, 36 insertions(+), 40 deletions(-) diff --git a/src/App.vue b/src/App.vue index 56b11d5..2048030 100644 --- a/src/App.vue +++ b/src/App.vue @@ -8,6 +8,7 @@ import Status from './components/status.vue' const currentWorkingCategory = ref(null) + const currentWorkingInstrument = ref(null) const summaryRef = ref(null) const statusRef = ref(null) const showCategoryRef = ref(null) @@ -26,6 +27,7 @@ response = await fetch(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'categories') categories.value = await response.json() currentWorkingCategory.value = categories.value[0] + currentWorkingInstrument.value = instruments.value.find(instrument => instrument.name === currentWorkingCategory.value.instrument) } onMounted(loadData) @@ -34,26 +36,29 @@
- + :currentWorkingCategory="currentWorkingCategory"/>-->
+ v-model:currentWorkingInstrument="currentWorkingInstrument" + v-model:currentWorkingCategory="currentWorkingCategory"/>
+ v-model:currentWorkingInstrument="currentWorkingInstrument" + v-model:currentWorkingCategory="currentWorkingCategory"/>
diff --git a/src/components/category_chooser.vue b/src/components/category_chooser.vue index c0d5c24..25c908a 100644 --- a/src/components/category_chooser.vue +++ b/src/components/category_chooser.vue @@ -1,21 +1,18 @@