.This Vite plugin adds support for importing an Accounting allowance file as a Vue element. Functions with Vue 2 & 3.Vue.js Trial Blocks.Provide your Vue.js code blocks inline through merely including demo next to the foreign language title.For instance, when this Fall report is actually provided with this plugin, you'll view a clickable switch listed below:."' vue demo.
Click me."'( end).Put in.npm put in -D vite-vue-md.Create.In your vite.config.js data:.Import vite-vue-md as well as incorporate it to the plugins range.In your vue() plugin options, include an include option that includes.md reports.vite.config.js:.import vue from '@vitejs/ plugin-vue'.+ import vueMd from 'vite-vue-md'.export nonpayment plugins: [// ...vue( + feature: [/. vue$/,/ . md$/]// u2190 Address MD documents as Vue elements. ),.+ vueMd(/ * Options */)// u2190 Organize MD reports to Vue elements.]// ...To collect a Vue.js codeblock as a Trial Block, include demo close to the language name:."' vue demonstration.
Click me."'( end).Multi-file trials.The entry aim for demonstration blocks need to be actually a Vue.js component. However you may import various other code blocks out in any language from the exact same Fall file.For non-entry data, set a data title through trial=. After that bring in it from the Vue.js demo block via the doc: method:.
Click me.
2nd report:.trial= click-handler. js.export const clickHandler = () => alert(' Clicked on!').Demonstration + Code blocks out.Since the code blocks are actually rendered inline, they are actually substituted due to the genuine Vue.js part. To show the code block, you can add a onDemo callback to the plugin options:.( onDemo( componentTag, code) // Register the cover component.this.registerComponent(' DemoContainer', './ DemoContainer.vue').// Profits a custom-made HTML string.gain '.$ componentTag
$ this.escapeHtml( code)'. ).Alternatives.feature.Type: ReadonlyArray|chain|RegExp.Reports to feature from being actually put together as Vue documents.omit.Style: ReadonlyArray|string|RegExp.Reports to omit coming from being organized as Vue data.markdownItOptions.Style: markdownIt.Options.MarkdownIt choices. See MarkdownIt's records for additional information.markdownItSetup.Style: (md: markdownIt) => space.Callback to include plugins to MarkdownIt.wrapperClass.Kind: strand.Nonpayment: markdown-body.The training class to include in the wrapper component that contains the Fall webpage.onDemo.Style:.(.tag: strand,.code: strand,.demos: Chart.) => cord.You can easily intercept each demo block and also come back a customized HTML cord. This serves for adding personalized styling to demonstration blocks.In addition, there are actually utils left open in the this circumstance:.escapeHtml: Escape HTML code to prevent it coming from being actually rendered as HTML.registerComponent: Register a component to be utilized in the demonstration block. This serves for enrolling components that are actually imported coming from other files.See example above in the Demonstration Blocks area.markdownCss.Kind: chain.Submit road to a stylesheet to utilize for the Accounting allowance webpage. This will definitely be actually included utilizing so it will only apply to the fall webpage. Helpful for designating merely the HTML produced by the MarkdownIt plugin.useVOnce.Style: boolean.Whether to add v-once to the whole entire Fall webpage. This are going to stop the Markdown webpage from being actually re-rendered when the Vue element is actually updated.Caution: This are going to disable trial blocks. Only use this if you possess a big documentation and do not require demonstration blocks.Associated.unplugin-vue-markdown.Another Vite plugin for assembling Markdown files to Vue parts.This plugin has actually attracted inspiration coming from it yet has a various attribute set. This plugin simply supports Vue.js code in code blocks.Github.Scenery Github.