1.函数组件
<span
onClick={jumpPage.bind(this,'https://book.jd.com/')}
style={{color:"#fc6532",cursor:'pointer'}}>
https://book.jd.com/
</span>
或者
<span
onClick={()=>jumpPage('https://book.jd.com/')}
style={{color:"#fc6532",cursor:'pointer'}}>
https://book.jd.com/
</span>
const jumpPage = (val)=>{
window.open(val)
}
2.class组件
<div
style={{maxHeight: '120px',minHeight:"60px"}}
className={'showinfo'}
onClick={()=>this.linkPage(book_link)}>
<span> 链接: </span>
{book_link}
</div>
linkPage=(val)=>{
window.open(val)
}