no message
Former-commit-id: 2307a927de9d95108586522b33bcab9a8941d30e Former-commit-id: e0d45eab6717de74eb4ba3516f106340a881cf5a Former-commit-id: 63f175e2c381710a8e53c338f7cfad56c06a37e0
This commit is contained in:
@@ -1,44 +1,5 @@
|
||||
<template>
|
||||
<Container type="ghost">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="12">
|
||||
<el-card>
|
||||
<PageHeader
|
||||
slot="header"
|
||||
title="基本示例"
|
||||
url="https://github.com/chjj/marked">
|
||||
</PageHeader>
|
||||
<pre>{{mdSource}}</pre>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-card>
|
||||
<template slot="header">解析结果</template>
|
||||
<div class="markdown-body" v-html="markedHTML"></div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<Container>
|
||||
<markdown url="/static/markdownFiles/article/组件 - markdown.md"></markdown>
|
||||
</Container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import marked from 'marked'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
mdSource: '',
|
||||
markedHTML: ''
|
||||
}
|
||||
},
|
||||
async mounted () {
|
||||
this.mdSource = await this.getReadme(this.url)
|
||||
this.markedHTML = marked(this.mdSource)
|
||||
},
|
||||
methods: {
|
||||
async getReadme () {
|
||||
const data = await this.$axios.get('/static/markdownFiles/demo/base.md')
|
||||
return data
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</template>
|
||||
Reference in New Issue
Block a user