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
No description provided.
The text was updated successfully, but these errors were encountered:
需要注意,每个bind(this)都会动态生成, 即 a.bind(this) != a.bind(this)
若有 b() { addEventListener(event, a.bind(this)) } 但需要 c() { removeEventListener(event, a.bind(this)) } 这会导致不能remove掉,写了一个autobind,统一在construct中就一次性绑定,后不再做绑定,这样即可正常remove
b() { addEventListener(event, a.bind(this)) }
c() { removeEventListener(event, a.bind(this)) }
Sorry, something went wrong.
突然想起,如果bind中需要传递参数的话,原本应写成bind(this,...),要想一次性绑定如何解决传参问题
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: