当前第2页 返回上一页
引入ant的Button组件
1 2 3 4 | <Button style={{backgroundColor: '#F0F2F5' }}
onClick={()=>{window.location.href= "https://baidu.com" }}
className= "r-button"
>
|
引入import {Link} from 'react-router-dom'
1 2 3 | <Link to= "/new/login/" >
<Button className= "e-button" type= "primary" >Back to login page</Button>
</Link>
|
(二)、本地页面不变跳转到新的页面
1 2 3 4 5 6 7 8 | <Button style={{backgroundColor: '#F0F2F5' }}
onClick={this.handle}
className= "last-button"
>
handle=()=>{
const w=window.open( 'about:blank' );
w.location.href= "www.baidu.com"
}
|
相关学习推荐:javascript视频教程
以上就是react中怎么点击跳转的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
React中如何引入图片
React中ref怎么用
React中jsx是什么
React中怎么获取state
React怎么写style
React中同级组件如何传值
React native怎么注释代码
React this绑定的几点思考
React怎么显示隐藏
vue和React中dom的区别
更多相关阅读请进入《React》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » react中怎么点击跳转