在子组件的渲染中 -
var currentPath = this.props.location.pathname,
parentPath = currentPath.substring(0, currentPath.lastIndexOf("/"));
return (<Link to={parentPath}>Up</Link>...);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2240 次 |
| 最近记录: |