0
例如: -在react-router中,如何直接从代码API调用链接?
this.onClick = function(){
// current path is '#/list'
// i want to go to '#/detail' by invoke an api
//how could i do?
}
到目前为止,我还没有发现在反应路由器任何可用的API。
例如: -在react-router中,如何直接从代码API调用链接?
this.onClick = function(){
// current path is '#/list'
// i want to go to '#/detail' by invoke an api
//how could i do?
}
到目前为止,我还没有发现在反应路由器任何可用的API。
使用History
模块,你可能已经与阵营路由器使用。然后,你可以这样做:
this.props.history.push('/yourPath');
你可以阅读更多的Navigating Outside Components文档。另请参阅Navigating section in CHANGES。