输入Enter输入时,我想运行一个模糊(焦点)事件。
我已确认通过鼠标单击发生了模糊(焦点)事件,如下代码所示。现在,我只想在按下Enter键时在内部处理模糊事件。
setup(editor) {
editor.on('focus', function(e) {
alert('focus');
});
editor.on('blur', function(e) {
alert('blur');
});
editor.on('keyup', function(e) {
if (e.keyCode === 13) {
// I want to handle blur(focus) events internally here.
}
});
}
是否可以使用'editor.execCommand'
来做到这一点?谢谢您的建议。