index.vue 721 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <v-container>
  3. <v-row class="mb-6">
  4. <v-col
  5. v-for="ch in chapters"
  6. :key="ch.chapterNum"
  7. cols="auto"
  8. >
  9. <chapter-card :name="ch.name" :description="ch.description" class="mx-6" :to="ch.to" />
  10. </v-col>
  11. </v-row>
  12. </v-container>
  13. </template>
  14. <script lang="ts">
  15. import Vue from 'vue'
  16. import ChapterCard from '~/components/learning/ChapterCard.vue'
  17. import { Chapter } from '~/data/chapters'
  18. export default Vue.extend({
  19. components: {
  20. ChapterCard
  21. },
  22. async asyncData() {
  23. const chapters = await import('~/data/chapters')
  24. return { chapters: chapters.default }
  25. },
  26. data() {
  27. return {
  28. chapters: [] as Chapter[]
  29. }
  30. }
  31. })
  32. </script>