I'm new to the @nuxt/content module and it's working well except within components.
Here I'm trying to get the content like so:
layout.vue
export default {
name: 'Default',
CONTENT: 'content',
async asyncData({ $content }) {
const content = await $content('content').fetch()
return { content }
},
}
component.vue
export default {
async fetch({ $content }) {
this.content = await this.$content('content', { deep: true }).fetch()
},
data() {
return { content }
},
}
How can I use content within components?