We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
根据bind的代码可以看出,el实际上绑定的回调函数其实是将handler包装后的proxy。在unbind函数中,当handler不存在的情况下,默认是解绑el上evt类型的所有回调函数,代码里面解绑的回调函授是从el.listeners取出来的,可el. listeners中的函数都是未包装的handler函数,因此,我认为这种情况下unbind是没有效果的,求解~~
The text was updated successfully, but these errors were encountered:
同学你太细心了~ 确实是个bug, 着手修复.
Sorry, something went wrong.
这个问题还没有修复?也就是说现在只能绑定事件,并不能解除事件绑定?
好像一直没去修复这个bug。 删除 if (!el.listeners[evt]) { el.listeners[evt] = [handler]; } else { el.listeners[evt].push(handler); }
if (!el.listeners[evt]) { el.listeners[evt] = [handler]; } else { el.listeners[evt].push(handler); }
在 this.proxies.push(proxy); 后面添加 if(!el.listeners[evt]) { el.listeners[evt] = [proxy]; } else { el.listeners[evt].push(proxy); }
this.proxies.push(proxy);
if(!el.listeners[evt]) { el.listeners[evt] = [proxy]; } else { el.listeners[evt].push(proxy); }
解绑函数的这个地方也有问题吧,这边this显然不是engine,是不是可以改成以下方式?
No branches or pull requests
根据bind的代码可以看出,el实际上绑定的回调函数其实是将handler包装后的proxy。在unbind函数中,当handler不存在的情况下,默认是解绑el上evt类型的所有回调函数,代码里面解绑的回调函授是从el.listeners取出来的,可el. listeners中的函数都是未包装的handler函数,因此,我认为这种情况下unbind是没有效果的,求解~~
The text was updated successfully, but these errors were encountered: