Client rendering of MDX string in a Vue3 app #1869
-
Hello everyone, I'm trying to add mdx support inside Vue3 blog. My goal is to:
Something that look like this:
I know it's probably not the best idea to render mdx on the client, but it's more for a proof of concept than professional usage. I read the documentation, but my english isn't really well. Is it possible to transform a string to mdx vue component? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Sure it’s possible. I recommend taking 30-60 minutes to read through the docs and getting an understanding of MDX. The docs highlight several ways to do such things. |
Beta Was this translation helpful? Give feedback.
Sure it’s possible. I recommend taking 30-60 minutes to read through the docs and getting an understanding of MDX. The docs highlight several ways to do such things.
E.g., see
evaluate
which is mentioned in many places, or see the MDX on demand guide.Vue is more complex though because it has a non-standard/custom JSX flavor, so you need to ship Babel with their custom plugin to browsers too. 🤷♂️