-
Can external API data (in markdown format) can be rendered using ContentRenderer with Nuxt Content? For example: i fetch article data from Directus。and the article is generated using directus markdown editor. content: "# title \n ## some text....." In the local document (It is the MD document in the content directory), I use the following method, which can work. <ContentRenderer :value="content">
<header>
<h1>{{ content.title }} <small>{{ content.name }}</small></h1>
<div class="blocks desc">
{{ content.description }}
</div>
</header>
<ContentRendererMarkdown :value="content" />
</ContentRenderer> is there any good ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Have you solved it yet? I also want to get the Md data from an external API and render it with nuxt-content. |
Beta Was this translation helpful? Give feedback.
-
I also needed this, and I used this solution: |
Beta Was this translation helpful? Give feedback.
-
you can use after add moudle const content = "# title \n ## some text....."
<MDC :value="content" tag="section" class="mdc-memo-prose prose"/> now, your custom content render by external api data has same style like your articles |
Beta Was this translation helpful? Give feedback.
For me, it is working. I have created a component named
MarkdownRenderer
with the following content:and then call it like this: