摘要: React事件处理方法中this指向为undefined的四种解决方案: 1. 定义事件后使用bind绑定this return ( <div> <button onClick={this.clickHander.bind(this)}>Click</button> </div> ) 2. 在构造函 阅读全文
posted @ 2022-06-21 21:22 HuangBingQuan 阅读(273) 评论(0) 推荐(0) 编辑