react 中子组件调用父组件的方法,通过props:
父组件:
<div className="tabC01"> <FTab tabCon={‘tabCon01‘} note={()=>this.isNote()}/></div> 子组件:
<span className="wh01" >股票持仓(前十)<img src={require("../../image/[email protected]")} className="iii" onClick={()=>this.props.note()} /></span>
原文地址:https://www.cnblogs.com/keleyz/p/9504294.html
时间: 2024-10-13 09:17:23