Skip to content

Commit

Permalink
Update NoteList.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
raselshikdar authored Oct 4, 2024
1 parent 9cf8922 commit 32b9259
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/content/NoteList.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<script lang="ts" setup>
const { data: noteCategories } = await useNotes()
import { useNotes } from '~/composables/content'
import NoteCard from './NoteCard.vue' // Import your NoteCard component
// Fetching the categories containing notes
const { data: categories } = await useNotes()
</script>

<template>
<div class="space-y-10">
<div v-for="(category, cKey) in noteCategories.body" :key="cKey">
<div v-for="(category, cKey) in categories.body" :key="cKey">
<SubTitle>{{ category.name }}</SubTitle>
<div class="grid md:grid-cols-2 gap-5">
<!-- Iterating over notes in each category -->
<NoteCard v-for="(note, nKey) in category.notes" :key="nKey" :note="note" />
</div>
</div>
Expand Down

0 comments on commit 32b9259

Please sign in to comment.