unplugin / unplugin-vue-markdown

Compile Markdown to Vue component
MIT License
508 stars 27 forks source link

How do I pass a value to markdown? #45

Open theOnlyUnique opened 5 months ago

theOnlyUnique commented 5 months ago

Clear and concise description of the problem

I want to be able to dynamically pass a value to markdown. What should I do? is there any way to let vue manipulate the frontmatter property? 我想要能够动态地传一个值进去给到markdown,请问我该怎么做,有什么方法能让vue操作frontmatter属性吗?

Suggested solution

It would be great to provide an entry to manipulate frontmatter attributes in vue3. If you already have it, can you write it in readme? thank you very much. 如果能提供一个在vue3里面操作frontmatter属性的入口就非常棒了,如果已经有了能麻烦写进readme吗,非常感谢

Alternative

No response

Additional context

No response

Validations

szabi commented 3 months ago

You can pass a value like this:

<script setup>
import { myValue } from '@/myModule';
const myOtherValue = 'Hello';
</script>

# Greeting

{{ myOtherValue }}, {{ myValue }}!