[英]Page is not redirecting to updated URL
我需要重定向到我的应用程序的新URL。 我有一个正在更改URL的事件。 此处URL已更新,但页面未重定向。 它仅在刷新后重定向。 请帮我解决这个问题。 谢谢。
JS:
_onNewFlowCreated(newFlow) {
let url= '/#/flows/'+ newFlow.uid +'/edit';
//window.history.pushState({}, '', url);
window.location.href= url;
}
我尝试使用react-router
。 但找不到解决方法。
试试这个
import { Router, Redirect, Route, Link, browserHistory, IndexRoute, useRouterHistory, RouterContext, hashHistory } from 'react-router';
import { createHashHistory } from 'history';
如果您使用reactjs,请使用
browserHistory.push('/#/flows/'+ newFlow.uid +'/edit');
导航到另一个URL
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.