ant-design-vue/examples/md.vue
2018-01-11 18:53:51 +08:00

25 lines
422 B
Vue

<template>
<div style="padding: 10px 0;" v-html="marked($slots.default[0].text.trim() || '')" />
</template>
<script>
import marked from 'marked'
marked.setOptions({
renderer: new marked.Renderer(),
gfm: true,
tables: true,
breaks: false,
pedantic: true,
sanitize: true,
smartLists: true,
smartypants: true,
})
export default {
name: 'md',
data () {
return {
marked,
}
},
}
</script>