diff --git a/src/components/markdown/index.vue b/src/components/markdown/index.vue index 48d815e..873170c 100644 --- a/src/components/markdown/index.vue +++ b/src/components/markdown/index.vue @@ -52,10 +52,23 @@ export default { console.log("not mounted init"); } }, + watch: { + source(val) { + if (val) { + this.initWithMd(); + } + }, + }, methods: { + handler(source) { + if (source) { + source = source.replace(/---\n([\s\S]*)---\n/, ""); + } + return source; + }, // 使用 md 初始化 initWithMd() { - this.markedHTML = this.marked(this.source); + this.markedHTML = this.marked(this.handler(this.source)); }, // 使用 url 初始化 async initWithUrl() { diff --git a/src/views/common/BreadCrumb.vue b/src/views/common/BreadCrumb.vue index 81d4b56..61a3eae 100644 --- a/src/views/common/BreadCrumb.vue +++ b/src/views/common/BreadCrumb.vue @@ -1,7 +1,7 @@