react跳转到外部链接 ╰半橙微兮° 2022-04-22 14:06 485阅读 0赞 > 1,route.config.js配置 { path: '/wikipedia', icon:'table', name: "wikipedia", component:'./Result/RedirectTo', }, > 2,在Result下面创建RedirectTo.js import React, { Component } from "react"; export class Redirect extends Component { constructor( props ){ super(); this.state = { ...props }; } componentWillMount(){ window.open("http://www.baidu.com"); } render(){ return (<section>已跳转页面...</section>); } } export default Redirect;
还没有评论,来说两句吧...