An open API service indexing awesome lists of open source software.

https://github.com/cloudacy/vue-markdown-render

A simple markdown parser for Vue using markdown-it.
https://github.com/cloudacy/vue-markdown-render

markdown-it vue vuejs

Last synced: 21 days ago
JSON representation

A simple markdown parser for Vue using markdown-it.

Awesome Lists containing this project

README

          

# vue-markdown-render

`vue-markdown-render` is a simple and lightweight wrapper for [markdown-it](https://markdown-it.github.io/) with full TypeScript support.

## Usage

```vue



import VueMarkdown from 'vue-markdown-render'

export default defineComponent({
name: 'MyComponent',
components: {
VueMarkdown
},
setup(props, ctx) {
const src = ref('# header')

return {
src
}
}
})

```

### Options

[markdown-it options](https://github.com/markdown-it/markdown-it#init-with-presets-and-options) can be passed as an object into the VueMarkdown component:

```vue

```

### Plugins

[markdown-it](https://github.com/markdown-it/markdown-it#plugins-load) compatible simple plugins can be passed as an array into the VueMarkdown component. Example using [MarkdownItAnchor](https://www.npmjs.com/package/markdown-it-anchor)
```vue

import VueMarkdown from 'vue-markdown-render'
import MarkdownItAnchor from 'markdown-it-anchor';

const plugins = [MarkdownItAnchor];

```

## TypeScript

If you are using typescript, you have to add the [@types/markdown-it](https://www.npmjs.com/package/@types/markdown-it) to your **dev dependencies**.

```bash
npm install @types/markdown-it --save-dev
```