Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@karry-design/vitepress-plugin-demo-preview

Package Overview
Dependencies
Maintainers
5
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@karry-design/vitepress-plugin-demo-preview

preview component of code and component in vitepress

  • 0.2.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

vitepress-plugin-demo-preview

Demo of Vue SFC components in vitepress

🎉 Introduce

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

🏄‍♂️ Packages

  • @karry-design/vitepress-plugin-demo-component

⚙️ Installation

pnpm add @karry-design/vitepress-plugin-demo-component @karry-design/vitepress-plugin-demo-preview

⚡ Usage

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)
    }
  }
})

Preview of Component Form


### 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>

📑 License

Keywords

FAQs

Package last updated on 05 Dec 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc