-
-
Notifications
You must be signed in to change notification settings - Fork 729
Closed
Description
Discussed in #1448
Originally posted by kjanusz August 14, 2022
I have the problem that the representation of data in default slot does not work.
I searched issues but found nothing.
Am I doing something wrong? My mistake of thinking?
This works (title is displayed)
<template>
<main>
<h1>{{ data.title }}</h1>
<ContentRenderer :value="data">
<template #empty>
<p>No content found.</p>
</template>
</ContentRenderer>
</main>
</template>
<script setup lang="ts">
const { path } = useRoute();
const { data } = await useAsyncData(`content-${path}`, () => queryContent().where({ _path: path, draft: { $ne: true } }).findOne())
</script>This does not work (title is not displayed)
<template>
<main>
<ContentRenderer :value="data">
<h1>{{ data.title }}</h1>
<template #empty>
<p>No content found.</p>
</template>
</ContentRenderer>
</main>
</template>
<script setup lang="ts">
const { path } = useRoute();
const { data } = await useAsyncData(`content-${path}`, () => queryContent().where({ _path: path, draft: { $ne: true } }).findOne())
</script>My configuration
"devDependencies": {
"@nuxt/content": "^2.0.1",
"nuxt": "3.0.0-rc.8",
}export default defineNuxtConfig({
// static HTML generation (SSG)
ssr: true,
target: "static",
modules: ["@nuxt/content"],
content: {
// https://content.nuxtjs.org/api/configuration
},
});Bug or Feature?
Metadata
Metadata
Assignees
Labels
No labels