Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/danielroe/roe.dev. This is the code and content for my personal website, built in Nuxt. roe.dev
Something went wrong. Try again.
598 B · 18 lines
TypeScript
12345678910111213141516171819import { ContentRenderer } from '#components'
export default defineComponent({ props: { collection: { type: String as () => 'page' | 'blog', required: true }, path: { type: String, required: true }, }, async setup (props) { if (import.meta.dev) { const { data } = await useAsyncData(() => queryCollection(props.collection).path(props.path!).first(), ) return () => h(ContentRenderer, { value: data.value! }) } const value = await queryCollection(props.collection).path(props.path!).first() return () => h(ContentRenderer, { value }) },})