Skip to content

cloudacy/vue-markdown-render

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-markdown-render

vue-markdown-render is a simple and lightweight wrapper for markdown-it with full TypeScript support.

Usage

<template>
  <div>
    <vue-markdown :source="src">
  </div>
</template>

<script lang="ts">
import VueMarkdown from 'vue-markdown-render'

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

    return {
      src
    }
  }
})
</script>

TypeScript

If you are using typescript, you have to add the @types/markdown-it to your dev dependencies.

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