gpt4 book ai didi

javascript - 如何在react-flux架构中导航到外部url?

转载 作者:行者123 更新时间:2023-12-03 02:07:23 25 4
gpt4 key购买 nike

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。

最佳答案

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

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

关于javascript - 如何在react-flux架构中导航到外部url?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49750920/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com