Hi all, I have a content component that shows title and publish date of my blog posts but it disappears on refresh. I'm using document-driven mode:
<script setup lang="ts">
const { page } = useContent()
function formatDate(date) {
return new Date(date).toLocaleDateString('en', {
year: 'numeric',
month: 'short',
day: 'numeric',
})
}
</script>
<template>
<div>
<h1 class="!mb-0">{{ page.title }}</h1>
<p class="m-0 !my-0 text-left text-sm md:text-lg text-stone-500">
{{ formatDate(page.createdAt) }}
</p>
<div class="flex mt-4">
<div v-for="(tag, index) in page.tag" :key="index" class="mr-2 bg-primary-dark text-sm py-0.5 px-2.5 shadow rounded-full lowercase text-stone-300 opacity-60">{{ tag }}</div>
</div>
</div>
</template>
And in nuxt.config my content section is:
content: {
documentDriven: true
},
Any idea why this would happen (I'm doing something wrong obviously)?