我想在 VersionLog.vue 文件 直接引入 markdown ,要怎么做,
在网上找的都是 markdown 编辑器,我不要那种的,我需要能直接解析掉,不用编辑器
VersionLog.vue
<template lang="html">
<div class="" id='editor'>
<!-- Log start -->
<div class="article" v-html="compiledMarkdown"></div>
<!-- Log end -->
</div>
</template>
<script>
import marked from 'marked'
export default {
name: 'Log',
data () {
return {
context: ""
}
},
computed:{
compiledMarkdown () {
return marked(this.context, { sanitize: true })
}
}
}
</script>