链接元素的反应滚动更改状态

时间:2018-07-27 11:35:00

标签: reactjs react-router

因此,基本上在应用程序的主页上,我有一个包含职业详细信息块的部分。
单击其中一个时,react-router重定向到新视图,类似于-class Career extends React.Component { render() { let vacancies; if (!this.props.vacancies.length) { vacancies = <p>Sorry, no vacations currently available.</p> } else { vacancies = this.props.vacancies.map((item) => ( <Link to={`/careers/${item.Id}`} className='career_position' key={item.Id}> {item.Title} {!!+item.IsHot && <LazyImg src={FireLogo} alt='Hot vacancy' />} </Link> )) } return ( <div className='career_container'> <h1 className='section_heading'>Career</h1> <div className="section_content"> <h3>We are hiring! Please, do not hestitate to contact us regarding any questions you might have.</h3> <div className='career_content_wrapper'> <div className='career_recruiter'> <LazyImg src={CareerRec} alt="Recruiter" /> <h2>Mary</h2> <h3>recruiter@leobit.co</h3> <a href="#" className="social_profile"><LazyImg src={LinkEdin} alt="Linkedin profile" /></a> <a href="#" className="social_profile"><LazyImg src={Skype} alt="Skype profile" /></a> </div> <div className='career_positions_container'> {vacancies} </div> </div> </div> </div> ); } }

因此,我只想使Career链接保持活动状态,而不要使其他链接(https://gyazo.com/f9da42d9a1d427c66e54026421fa2b6b)保持活动状态。

代码:

{{1}}

0 个答案:

没有答案
相关问题