We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
content/code/template.md:
content/code/template.md
```js module.exports = {} ```
page.vue
<ContentQuery path="code/template" v-slot="{ data }"> <ContentRenderer :value="data" /> </ContentQuery>
Taken from the documentation example.
The above just prints out an object like:
{ "message": "You should use slots with <ContentRenderer>", "value": [ { "_path": "/code/template", "_dir": "code", "_draft": false, "_partial": false, "_locale": "", // ...
If I try using a slot with <ContentRedererMarkdown> like shown in the docs:
<ContentRedererMarkdown>
<ContentQuery path="code/template" v-slot="{ data }"> <ContentRenderer :value="data"> <ContentRendererMarkdown :value="data" /> </ContentRenderer> </ContentQuery>
I get a build error with the following log:
[Vue warn]: Component ContentRendererMarkdown is missing template or render function.
I just have an .md file that I want to render with syntax highlighting in a .vue page, what am I doing wrong?
No response
The text was updated successfully, but these errors were encountered:
Hello,
In fact, there is an issue with the example (I will create a PR to fix it).
By default, the ContentQuery will fetch all returning an array (https://github.com/nuxt/content/blob/main/src/runtime/components/ContentQuery.vue#L77). We can use the props find="one" to force the query to return only one item.
ContentQuery
find="one"
The solution : https://stackblitz.com/edit/github-xquzdt?file=pages%2Findex.vue
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Environment
Reproduction
content/code/template.md
:page.vue
Describe the bug
Taken from the documentation example.
The above just prints out an object like:
If I try using a slot with
<ContentRedererMarkdown>
like shown in the docs:I get a build error with the following log:
I just have an .md file that I want to render with syntax highlighting in a .vue page, what am I doing wrong?
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: