mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-04 21:18:14 +08:00
25 lines
422 B
Vue
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>
|