This commit is contained in:
2022-10-22 13:05:46 +02:00
parent 94829e833e
commit 60b53653d1
2 changed files with 8 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
<v-container>
<v-row>
<v-col v-for="course, id in courses" :key="id">
<v-card :width="vCardSize" :height="vCardSize" align="center" justify="center" @click="openCourse">
<v-card :width="vCardSize" :height="vCardSize" align="center" justify="center" @click="openCourse(id)">
{{ id.toUpperCase() }} - {{ course.name }}
</v-card>
</v-col>
@@ -11,6 +11,7 @@
</template>
<script>
import _cloneDeep from 'lodash-es/cloneDeep'
import { collection, getDocs } from 'firebase/firestore'
export default {
@@ -39,13 +40,13 @@ export default {
})
// Save courses in Vuex store
this.$store.commit('setCourses', courses)
this.$store.commit('setCourses', _cloneDeep(courses))
})
},
methods: {
openCourse () {
// TODO
this.$toast({ content: 'TODO: Eigener Bereich für jeden Kurs.', color: 'info', timeout: 3000 })
openCourse (courseID) {
this.$store.commit('setSelectedCourse', courseID)
this.$router.push(`courses/${courseID}`)
}
}
}