猿问

新手上路,react给子组件传递一个函数的时候,子组件如何增加参数?

父组件
handleIO=(id,type)=>{
console.log(id,type)
}
this.handleIO(e.id)}/>
子组件
handleBtn('decrease')}className={style.decrease}>
{num}
handleBtn('increase')}className={style.increase}>
父组件传递给子组件的入参为id,子组件根据不同的按钮触发分别加上不同的状态参数
类似vue中$event这种,该如何实现呢
呼如林
浏览 959回答 2
2回答
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答