首先哈,我知道 event.preventDefault();这种阻止冒泡的方法,大师问题是我之前在onclick里面已经传递参数了,无法用event,应该怎么破啊,代码如下
changeActive(index){
return () => {
const dataSource = [...this.state.dataSource];
dataSource[index].state = '激活';
this.setState({ dataSource });
};
};
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
试试:
给事件添加一层匿名函数来阻止冒泡