-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
建议:1.3之后未bind检测 #3340
Comments
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
@excxapp 之前的实现在小程序平台会帮开发者 bind,但如果你 build h5 的话还是会报错让你 bind 的。所以我觉得这里应该和 react 统一,开发者手动 bind,也符合 JS 直观。 |
也不是所有事件都需要 bind this,如果你写之前在构造器 bind 可以不用,在类属性写箭头函数也不用,在构造器写箭头函数重新赋值也不用,写柯里化也不用,直接在事件处写箭头函数也不用,除了直接在事件处写箭头函数之外,别的方法都无法检测到是不是需要 bind。 如果做一刀切的改动反而会让不少自己代码没问题的开发者产生疑惑,我觉得还是开发者自己动手比较合适。 |
的确有些脑瓜疼 |
Hello~ 您的问题楼上已经有了确切的回答,如果没有更多的问题这个 issue 将在 15 天后被自动关闭。 如果您在这 15 天中更新更多信息自动关闭的流程会自动取消,如有其他问题也可以发起新的 Issue。 Good luck and happy coding~ |
我们看看 taro doctor 能不能识别出来 |
升级1.3之后所有事件必须写bind(this
但是很多之前的都没有,建议添加批量修改软件,降低升级成本。
或者使用doctor检测出来
The text was updated successfully, but these errors were encountered: