1. 简单示例

...
deleteIP(e) {
    // 使用 e.target.getAttribute 来取值
    this.state.whitelist.splice(e.target.getAttribute("data"), 1);
    this.setState({'whitelist': this.state.whitelist});
},
...
// 使用data来传值
<Button data={item} onClick={this.deleteIP}>删 除</Button>
...

2. 参考 todolist

 

相关文章:

  • 2022-12-23
  • 2021-05-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-01-14
  • 2021-11-19
  • 2022-12-23
  • 2021-11-01
相关资源
相似解决方案