我使用的反应路由器V4如何从没有结尾的斜线路由到子目录?
假设我在以下位置
http://localhost:3000/articles
我想这个位置有一个反应的路由器链接元素,它指向
http://localhost:3000/articles/new
第一次尝试:
<Link to="new" />
个
点
http://localhost:3000/new
第二次尝试:
<Link to="/new" />
从任何位置点
http://localhost:3000/new
第三次尝试:
<Link to="new" />
从
http://localhost:3000/articles/ /* notice the slash at the end */
点
在
http://localhost:3000/articles/new
成功,但我需要它的工作范围:
http://localhost:3000/articles
你能张贴你的路线文件吗? –
不好意思,但路由是分布在几个文件之间,所以这将是太多的代码 – henk