修改Markdown格式的历史版本显示问题

This commit is contained in:
暮光:城中城
2020-09-06 14:36:26 +08:00
parent a01699bd12
commit 942b25e9ce
4 changed files with 9 additions and 6 deletions

View File

@@ -389,13 +389,16 @@
// 缓存一下,但如果历史页面多了而且很大就占内存,也可以每次去拉取,先这样吧
if (history.content) {
history.loading = 2;
this.pageHistoryDetail = history.content || '内容为空';
this.pageHistoryDetail = history.content;
} else {
history.loading = 1;
pageApi.pageHistoryDetail({id: history.id}).then(json => {
history.loading = 2;
this.pageHistoryDetail = json.data || '内容为空';
history.content = json.data || '内容为空';
history.content = json.data || '--';
if (this.wikiPage.editorType === 2) {
history.content = markdownIt.render(history.content);
}
this.pageHistoryDetail = history.content;
});
}
},