🎨 启用代码行号功能

This commit is contained in:
ronger 2020-08-11 09:38:16 +08:00
parent b6767f3b31
commit 567777d965
3 changed files with 11 additions and 1 deletions

View File

@ -202,6 +202,11 @@
_ts.contentEditor.setValue(data.value ? data.value : ''); _ts.contentEditor.setValue(data.value ? data.value : '');
}, },
preview: { preview: {
hljs: {
enable: true,
lineNumber: true,
style: 'github'
},
markdown: { markdown: {
toc: true, toc: true,
}, },

View File

@ -199,7 +199,7 @@
// //const outLineElement = document.getElementById("articleToC"); // //const outLineElement = document.getElementById("articleToC");
// VditorPreview.setContentTheme('light'); // VditorPreview.setContentTheme('light');
Vue.VditorPreview.codeRender(previewElement, 'zh_CN'); Vue.VditorPreview.codeRender(previewElement, 'zh_CN');
Vue.VditorPreview.highlightRender({"enable": true, "lineNumber": false, "style": "github"}, previewElement); Vue.VditorPreview.highlightRender({"enable": true, "lineNumber": true, "style": "github"}, previewElement);
Vue.VditorPreview.mathRender(previewElement, { Vue.VditorPreview.mathRender(previewElement, {
math: {"engine": "KaTeX", "inlineDigit": false, "macros": {}}, math: {"engine": "KaTeX", "inlineDigit": false, "macros": {}},
}); });

View File

@ -145,6 +145,11 @@
_ts.contentEditor.setValue(data.value ? data.value : ''); _ts.contentEditor.setValue(data.value ? data.value : '');
}, },
preview: { preview: {
hljs: {
enable: true,
lineNumber: true,
style: 'github'
},
markdown: { markdown: {
toc: true, toc: true,
}, },