Component
Less than 1 minute
You can easily insert components in Markdown content with component code block.
Settings
import { hopeTheme } from "vuepress-theme-hope";
export default hopeTheme({
markdown: {
component: true,
// other options...
},
});Usage
You can use component fence block to add a component into your markdown content. Both YAML and JSON format props data are supported:
YAML Recommended:
```component ComponentName # component data here ```JSON:
```component ComponentName { // component data here } ```
Demo
VPCard
```component VPCard
title: Mr.Hope
desc: Where there is light, there is hope
logo: https://mister-hope.com/logo.svg
link: https://mister-hope.com
background: rgba(253, 230, 138, 0.15)
```
```component VPCard
{
"title": "Mr.Hope",
"desc": "Where there is light, there is hope",
"logo": "https://mister-hope.com/logo.svg",
"link": "https://mister-hope.com",
"background": "rgba(253, 230, 138, 0.15)"
}
```<VPCard> here is a global component.
The above code blocks are equivalent to:
<VPCard
title="Mr.Hope"
desc="Where there is light, there is hope"
logo="https://mister-hope.com/logo.svg"
link="https://mister-hope.com"
background="rgba(253, 230, 138, 0.15)"
/>Changelog
6/4/25, 1:34 PM
View All Changelog
1bd5f-on55e92-onb1230-on22787-onb41c0-on54c46-on5c0cb-on6c537-on2dbdd-on55ea3-on757fd-on83bff-onde04a-on7e98c-on2ceba-ond06e4-on