logging time updates summary

practiced-songs
Matthew Huntington 1 year ago
parent d1cdfba63d
commit a0bcfb8c3c

@ -8,9 +8,15 @@
import Status from './components/status.vue'
const currentWorkingCategoryID = ref(1)
const summaryRef = ref(null);
const updateCurrentWorkingCategoryID = (id) =>{
currentWorkingCategoryID.value = id
}
const refreshPage = () => {
summaryRef.value.loadData()
}
</script>
@ -18,10 +24,10 @@
<main>
<section id="timer">
<Status />
<Timer :currentWorkingCategoryID="currentWorkingCategoryID"/>
<Timer @loggedTime="refreshPage" :currentWorkingCategoryID="currentWorkingCategoryID"/>
</section>
<section id="summary">
<Summary @update="updateCurrentWorkingCategoryID"/>
<Summary ref="summaryRef" @update="updateCurrentWorkingCategoryID"/>
</section>
<section id="category">
<ShowCategory :currentWorkingCategoryID="currentWorkingCategoryID"/>

@ -1,5 +1,5 @@
<script setup>
import { onMounted, ref } from 'vue'
import { onMounted, ref, defineExpose } from 'vue'
const emit = defineEmits(['update'])
const categories = ref([])
@ -14,6 +14,8 @@
const setWorkingCategory = (category) => {
emit('update', category.category_id)
}
defineExpose({loadData})
</script>
<template>

@ -24,6 +24,7 @@
practice_category_id:0
}
},
emits: ['loggedTime'],
methods: {
formatSeconds,
submit(event){
@ -48,6 +49,7 @@
this.comments = null;
this.secondsToSubtract = 0;
window.localStorage.setItem('lastTotalSeconds', this.totalSeconds);
this.$emit('loggedTime')
});
},

Loading…
Cancel
Save