.This Vite plugin adds assistance for importing an Accounting allowance report as a Vue element. Functions along with Vue 2 & 3.Vue.js Trial Blocks.Make your Vue.js code blocks inline by simply including trial close to the language label.For instance, when this Accounting allowance file is left with this plugin, you'll find a clickable button right here:."' vue demonstration.
Click me."'( end).Mount.npm set up -D vite-vue-md.Create.In your vite.config.js data:.Import vite-vue-md and also incorporate it to the plugins collection.In your vue() plugin choices, add a feature possibility that includes.md files.vite.config.js:.import vue from '@vitejs/ plugin-vue'.+ bring in vueMd coming from 'vite-vue-md'.export default plugins: [// ...vue( + include: [/. vue$/,/ . md$/]// u2190 Deal with MD data as Vue parts. ),.+ vueMd(/ * Options */)// u2190 Assemble MD files to Vue components.]// ...To organize a Vue.js codeblock as a Demonstration Block, incorporate trial beside the foreign language name:."' vue trial.
Click me."'( end).Multi-file demonstrations.The entry objective for demo blocks should be actually a Vue.js part. But you can easily import other code shuts out in any type of language coming from the exact same Fall report.For non-entry reports, established a report title using demo=. After that import it coming from the Vue.js demo block through the doctor: method:.
Click me.
2nd data:.demonstration= click-handler. js.export const clickHandler = () => sharp(' Clicked!').Trial + Code shuts out.Since the code blocks are rendered inline, they're switched out due to the real Vue.js element. To reveal the code block, you can easily add a onDemo callback to the plugin alternatives:.( onDemo( componentTag, code) // Register the cover component.this.registerComponent(' DemoContainer', './ DemoContainer.vue').// Return a custom HTML cord.profit '.$ componentTag
$ this.escapeHtml( code)'. ).Alternatives.include.Kind: ReadonlyArray|string|RegExp.Files to feature from being assembled as Vue data.exclude.Type: ReadonlyArray|chain|RegExp.Documents to omit coming from being collected as Vue reports.markdownItOptions.Kind: markdownIt.Options.MarkdownIt possibilities. Check out MarkdownIt's paperwork for additional information.markdownItSetup.Kind: (md: markdownIt) => space.Callback to include plugins to MarkdownIt.wrapperClass.Type: string.Default: markdown-body.The course to add to the cover element that contains the Fall web page.onDemo.Style:.(.tag: string,.code: strand,.demonstrations: Map.) => cord.You may obstruct each trial block and come back a custom HTML string. This works for incorporating customized designing to demo blocks.In addition, there are actually utils subjected in the this circumstance:.escapeHtml: Getaway HTML code to stop it coming from being actually rendered as HTML.registerComponent: Sign up an element to be used in the demo block. This serves for registering elements that are imported from various other data.View example over in the Demo Blocks section.markdownCss.Kind: chain.Submit course to a stylesheet to utilize for the Fall webpage. This will certainly be actually included making use of so it will just put on the fall page. Helpful for designating simply the HTML produced due to the MarkdownIt plugin.useVOnce.Type: boolean.Whether to add v-once to the whole Accounting allowance page. This will protect against the Accounting allowance web page from being re-rendered when the Vue part is improved.Precaution: This are going to turn off demo blocks. Merely utilize this if you have a big document and do not require demo blocks.Connected.unplugin-vue-markdown.Yet another Vite plugin for collecting Markdown reports to Vue elements.This plugin has drawn motivation coming from it but possesses a different attribute collection. This plugin merely assists Vue.js code in code blocks.Github.View Github.