<Link to={ { pathname: '/particulars', state: { drug: drug} } } target="_blank">
<div style={ { color: 'blue', fontSize: '1.1rem' } } dangerouslySetInnerHTML={ { __html: drug.showName } }></div>
</Link>
//link
<BrowserRouter>
<div >
<Route path={ '/' } exact={ true } component={ ()=> <AllSymptom /> } />
<Route path={ '/particulars' } exact={ true } component={ (location)=> <Symptom location = {location}/> } />
</div>
</BrowserRouter>
//router
console.log((this.props.location.location.state.drug));
//子组件
`
``
reactRouter 参数对象
最新推荐文章于 2025-05-01 07:44:49 发布