Skip to content

fyhhub/vitepress-plugin-vue-repl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vitepress-plugin-vue-repl

install

npm i vitepress-plugin-vue-repl -D

config

// config.ts
import { VueReplMdPlugin } from 'vitepress-plugin-vue-repl';

export default defineConfig({
  markdown: {
    config: (md) => {
      md.use(VueReplMdPlugin)
    }
  },
})
// theme/index.ts
import Playground from 'vitepress-plugin-vue-repl/components/index.vue'
import DefaultTheme from 'vitepress/theme';

export default {
    ...DefaultTheme,
    enhanceApp(ctx) {
      ctx.app.component('VuePlayground', Playground);
    },
};

Usage

16940542830411694054282196.png

16940543340541694054333997.png

Code Editor Config

  • Monaco
  • CodeMirror

16969186209081696918620011.png

Vue Repl Config & imports

16970099573521697009956483.png