mirror of
https://github.com/doocs/md.git
synced 2024-11-25 03:18:36 +08:00
fix: code prettify
This commit is contained in:
parent
53bbbed3c4
commit
21e21eedf3
@ -77,6 +77,7 @@ export default {
|
|||||||
aboutDialogVisible: false,
|
aboutDialogVisible: false,
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
timeout: null,
|
timeout: null,
|
||||||
|
changeTimer: null,
|
||||||
source: ''
|
source: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -106,11 +107,13 @@ export default {
|
|||||||
initEditor() {
|
initEditor() {
|
||||||
this.initEditorEntity();
|
this.initEditorEntity();
|
||||||
this.editor.on('change', (cm, e) => {
|
this.editor.on('change', (cm, e) => {
|
||||||
|
if (this.changeTimer) clearTimeout(this.changeTimer);
|
||||||
|
this.changeTimer = setTimeout(() => {
|
||||||
|
setTimeout(()=> PR.prettyPrint(), 0);
|
||||||
this.editorRefresh()
|
this.editorRefresh()
|
||||||
setTimeout(() => {
|
console.log('tick');
|
||||||
PR.prettyPrint()
|
|
||||||
}, 300);
|
|
||||||
saveEditorContent(this.editor, '__editor_content')
|
saveEditorContent(this.editor, '__editor_content')
|
||||||
|
}, 300);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 粘贴上传图片并插入
|
// 粘贴上传图片并插入
|
||||||
|
Loading…
Reference in New Issue
Block a user