1
npm install markdown-it --save
2
<script>
import MarkdownIt from 'markdown-it'
const md = new MarkdownIt()
export default {
name: 'Post',
metaInfo: {
title: 'Post',
},
methods: {
mdToHtml (markdown) {
return md.render(markdown)
}
}
}
</script>
3
<div class="col-lg-8 col-md-10 mx-auto" v-html="mdToHtml($page.post.content)"></div>
网友评论