使用ACE编辑器,我如何解除绑定事件? [英] With the ACE Editor, how can I unbind an event?
本文介绍了使用ACE编辑器,我如何解除绑定事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
https://github.com/ajaxorg/ace/wiki/Embedding- --API
editor.session.on('change', callback);
是将事件绑定到更改的方式。但是我如何解除绑定呢?
is how you bind an event to "change". But how do I unbind it?
推荐答案
使用 removeListener
删除特定的回调。
editor.session.removeListener('change', callback);
或更短版本
editor.session.off('change', callback);
使用 removeAllListeners
删除所有回调。
editor.session.removeAllListeners('change');
这篇关于使用ACE编辑器,我如何解除绑定事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文