perf: 文件文本编辑支持command+s保存

This commit is contained in:
kuaifan 2022-06-10 08:17:51 +08:00
parent b4c1d05d2e
commit 02f75726c5

View File

@ -386,6 +386,14 @@
this.submitNewContent();
}
});
editor.on('KeyDown', (e) => {
if (e.metaKey || e.ctrlKey) {
if (e.keyCode === 83) {
e.preventDefault();
this.$emit('editorSave', e);
}
}
});
editor.on('Change', (e) => {
if (this.editor !== null) {
if (this.getContent() !== this.value) {