【问题标题】:How to navigate to external url in react-flux architecture?如何在 react-flux 架构中导航到外部 url?
【发布时间】:2018-04-10 10:08:36
【问题描述】:
import React, { PropTypes } from 'react';
import { Link, browserHistory } from 'react-router';
class Chatbox extends React.Component {
constructor(props) {
    super(props);
    this.state = {

    };

}
componentDidMount() {

}
render() {
return (
        <div className="content_block"> 
            <Link to='/chatbox'></Link>
         </div>
    )
}
}
export default Chatbox;

我正在渲染区域中渲染聊天框组件,我需要运行其他应用程序 url。

我正在使用以下路线,但它正在重定向到该位置,而不是在聊天框呈现区域中呈现。

<Route path='/chatbox' component={() => window.location = 'http://localhost:5000/chat'}/>

如何在组件渲染区域导航“http://localhost:5000/chat”url。

【问题讨论】:

    标签: javascript reactjs react-router url-routing


    【解决方案1】:

    您可以使用 iframe 在您的内部呈现外部网站。

    render() {
      return (
        <div className="content_block"> 
             <iframe src="http://localhost:5000/chat" width="640" height="480" align="left">Not supported</iframe>
         </div>
      );
    }
    

    【讨论】:

      猜你喜欢
      • 2016-12-14
      • 2021-03-09
      • 1970-01-01
      • 1970-01-01
      • 2020-02-23
      • 2011-03-18
      • 2017-11-19
      • 2017-10-10
      • 2014-10-03
      相关资源
      最近更新 更多