Vue components not getting rendered in Markdown
I'm fairly sure this is a misunderstanding of the docs rather than a bug, but I'm sure other people will encounter this problem.
Version
@nuxtjs/content: v0.3.0 @nuxt/components: v0.2.5 @nuxt: v2.12.0
Reproduction Link
Steps to reproduce
There are two uses of the MarginalNote component in this sandbox. One is used directly in _slug.vue (but is commented out), the other is a Vue component in content/index.md. Look at the page as it is right now - the MarginalNote in the Markdown file is not getting rendered.
However, it will render if you uncomment the one used directly in _slug.vue.
What is Expected?
I was hoping I could just use Vue components in Markdown as specified on the docs. I've checked both the content docs and the components docs, not sure if components isn't intended to be used this way, but otherwise how should these components be "imported" in Markdown?
What is actually happening?
My Vue component isn't rendered when used in Markdown, and it seems like this may be because it isn't getting imported.
Hi @thely
Actually it is the same issue as https://github.com/nuxt/components/issues/13#issuecomment-630283808
You will need to import the components you will use in the actual page at the moment.
This really needs to be a part of the documentation for content - spent quite a bit of time researching why Vue components weren't loading properly in Markdown files.
Is there any way I can help to add to the documentation? I would think here would be a good place to remind others that they need to globally register Vue components in order to use them in .md files.
Probably obvious to many, but not to me. In fact, I had it working with other components just fine, but forgot that I actually had to register them elsewhere. If it was written in the docs, it would have been a nice reminder.
For anyone who stumbles upon the same issue and the upper solution does not work: I had to register my custom component globally via a plugin. Then it got rendered in the markdown.