📜  ckeditor 5 on blur - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:20.507000             🧑  作者: Mango

代码示例1
var editor_changed = false;

editor.model.document.on('change:data', () => { editor_changed = true; });

editor.ui.focusTracker.on('change:isFocused', (evt, name, isFocused) => {
  if(!isFocused && editor_changed) {
    editor_changed = false;
    console.log(editor.getData());
  }
} );