首先哈,我知道 event.preventDefault();这种阻止冒泡的方法,大师问题是我之前在onclick里面已经传递参数了,无法用event,应该怎么破啊,代码如下
changeActive(index){
return () => {
const dataSource = [...this.state.dataSource];
dataSource[index].state = '激活';
this.setState({ dataSource });
};
};
试试: