簡體   English   中英

使用Flow Router,Meteor和React導航

[英]Navigation with Flow Router, Meteor and React

我在將客戶重定向到某個地址時遇到問題。

例如,客戶端轉到該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路由器。

您需要在網址前加一個斜杠:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM