
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@karry-design/vitepress-plugin-demo-component
Advanced tools
preview component of code and component in vitepress
We can see their component display and code example display from some excellent UI component libraries such as element-plus
and Ant Design Vue
This project is based on vitepress
and markdown-it
implementation to display components and code examples in documents. Using this plug-in, Vue SFC components can be displayed in static documents
pnpm add @karry-design/vitepress-plugin-demo-component @karry-design/vitepress-plugin-demo-preview
configure in your vitepress/theme entry file
import { AntDesignContainer, ElementPlusContainer, NaiveUIContainer } from '@vitepress-demo-preview/component'
import '@vitepress-demo-preview/component/dist/style.css'
export default {
...DefaultTheme,
enhanceApp({ app }: { app: App }) {
app.component('demo-preview', AntDesignContainer)
}
}
configure markdown to add plugin
import { defineConfig } from 'vitepress'
import { containerPreview, componentPreview } from '@vitepress-demo-preview/plugin'
export default defineConfig({
markdown: {
config(md) {
md.use(containerPreview)
md.use(componentPreview)
}
}
})
### Single-line
<Preview path="./components/ComponentPreview.vue" title="Component Preview"></Preview>
### Multi-line
<Preview
path="./components/ComponentPreview.vue"
title="Component Preview"
></Preview>
### Multi-line Description
<Preview
path="./components/ComponentPreview.vue"
title="Component Preview"
description="Preview By Component Form"
>
<template #description>
<h1>this is slot data</h1>
<h2> level</h2>
</template>
</Preview>
### Single-line Description
<Preview path="./components/ComponentPreview.vue" title="Component Preview" description="Preview By Component Form"></Preview>
Name | Description | Explanation |
---|---|---|
path | Demo path | Cannot be left blank |
title | Explanation | - |
description | Description | - |
noCode | Do not display code | Default false |
description
: Extension for descriptive content.FAQs
preview component of code and component in vitepress
We found that @karry-design/vitepress-plugin-demo-component demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.