Skip to content
New issue

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

[Discussion/Question] Can I pass props into my Markdown components and have them rendered within the Markdown component? #36

Open
cjholowatyj opened this issue Jan 18, 2024 · 1 comment

Comments

@cjholowatyj
Copy link
Contributor

Can I pass props into my Markdown components and have them rendered within the Markdown component? For example, would I be able to do something like...

<!-- Page.vue -->
<template>
    <MarkdownComponent :slogan="markdownSlogan"/>
</template>

<script setup>
import MarkdownComponent from 'markdown-component.md';
const markdownSlogan = "Here we grow again!";
</script>
<!-- markdown-component.md -->
# Title

## {{ props.slogan }}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus rutrum risus lacus, ...

If this functionality is already available, it is not clearly documented in the README.md. If it isn't already available Please consider this a feature request!

@FlickerSoul
Copy link

You can use <script setup> in your markdown file so theoretically I think you can use defineProps and get props working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants