-
-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature request] unbind 指定的 handler 而不是一下子解绑所有的 #44
Comments
@JounQin 事实上你可以通过 |
@jaywcjlove scope 一次只能生效一个 scope + 'all' 吧? |
@JounQin 你可以在代码执行的时候 随意切换 |
比如在页面里有很多子模块,他们可能对同一个按键组合同时做监听,子模块卸载的时候要把对应的监听 unbind,切 scope 不能使监听同时生效啊。 |
@JounQin 你这样,不能把快捷键写到单独的 component 里面去,监听事件绑定到 document 上,如果放到单独的 component 里面,对其它 component 里面的快捷键没有办法控制。 如果不绑定到 document 上,绑定到对应的 component 根节点上,会导致,部分区域获得焦点才能触发事件 解决办法: 根组件, 使用 |
我只是说明一种情景,每个子模块都可能是不同人维护的,其他组件想监听相同的快捷键,用一个监听全局通知当然是好的,但是为什么不能像 jQuery 对 document 可以监听多次,也可以单独取消某个特定的监听器一样呢? Related: madrobby/keymaster#133 |
keymaster 这种方式也可以,我回头给加上去 |
As title.
The text was updated successfully, but these errors were encountered: