【问题标题】:Navigation with Flow Router, Meteor and React使用 Flow Router、Meteor 和 React 进行导航
【发布时间】:2016-12-12 10:00:46
【问题描述】:

我在将客户重定向到某个地址时遇到问题。

例如,客户端转到此 url,“http://localhost:3000/home”。 如果客户端使用此代码转到“http://localhost:3000/msg”,

<a href="msg" >Link</a>

它正在工作。但是当来自“http://localhost:3000/people/231233213123”的客户端和客户端点击这段代码的链接时,

<a href="msg">Link</a>

它将转到“http://localhost:3000/people/231233213123/msg”。

我需要让客户端转到“http://localhost:3000/msg”。

我尝试使用此代码,

<a href="../../msg">Link</a>

但它会重定向到“http://localhost:3000/people/msg”。

我在 React 和 Meteor 中使用 Flow 路由器。

【问题讨论】:

    标签: javascript reactjs meteor


    【解决方案1】:

    你需要在网址前加一个斜杠:

    <a href="/msg">Link</a>
    

    【讨论】:

      猜你喜欢
      • 2016-10-31
      • 2020-05-18
      • 2017-06-17
      • 1970-01-01
      • 2016-05-25
      • 2014-08-13
      • 2017-10-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多