<template>
|
<div class="md-content">
|
<mark-down-it-vue class="md-body" :content="htmlMD"></mark-down-it-vue>
|
</div>
|
</template>
|
|
<script>
|
import MarkDownItVue from "markdown-it-vue"
|
import "markdown-it-vue/dist/markdown-it-vue.css"
|
import {verifyNull} from "@/util/validate";
|
|
export default {
|
name: "readMD",
|
components: {MarkDownItVue},
|
data() {
|
return {
|
htmlMD: "",
|
type:''
|
}
|
},
|
created() {
|
if (verifyNull(this.$route.query.type)) {
|
this.$message.error("配置的信息错误,请配置type参数");
|
return false;
|
}
|
this.type=this.$route.query.type;
|
axios.get(`./src/configDoc/${this.type}.md`).then((response) => {
|
this.htmlMD = response.data;
|
});
|
/*require(`@/configDoc/${this.type}.md`).then((markdown) => {
|
debugger;
|
this.htmlMD = markdown;
|
}).catch((error) => {
|
console.log('配置文档读取失败:', error);
|
});*/
|
}
|
}
|
</script>
|
|
<style scoped>
|
|
</style>
|