-
I know with Nuxt MDC that components must be either marked as global or put inside the I know VitePress does something similar to this, if anyone could offer a bit of guidance that be greatly appreciated.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
SolutionI did finally find a way to do this, I did not want to put the entire design system in the content dir and at the same time I can't make everything global since in some places I need to import the components to create components with render functions. If we have a page for example with legal content and want to import a grid cell component so we can use just that on our legal pages we can inject it with the content renderer.
<script setup>
import GridCell from '#components'
</script>
<template>
<ContentRenderer :components="{ GridCell }" />
</template> This way we can use it in a markdown file
|
Beta Was this translation helpful? Give feedback.
Solution
I did finally find a way to do this, I did not want to put the entire design system in the content dir and at the same time I can't make everything global since in some places I need to import the components to create components with render functions.
If we have a page for example with legal content and want to import a grid cell component so we can use just that on our legal pages we can inject it with the content renderer.
/pages/lega/[...slug].vue
This way we can use it in a markdown file