2017-02-28 100 views
0

我是新來的反應我已經創建了一個網站,但現在我想創建一個這樣的網站地圖(從其他網站捕獲)。我認爲它必須通過反應路由器來完成,但我仍然不確定,我不知道如何使用react-router做到這一點。如何爲反應中的網站創建網站地圖?

enter image description here

我有一個路由器組成部分有點像這個

<Route path="/" component={LoginBox}/> 
<Route path="/product" component={ProductLanding}/> 
<Route path="/dashboard" component={DashBoard}/> 
<Route path="/salesfunnel" component={Salesfunnel}/> 
<Route path="/addmeeting" component={AddMeeting}/> 
<Route path="/pitchProduct" component={PitchProduct}/> 
<Route path="/mysubs" component={MySubs}/> 
<Route path="/updateproduct" component={UpdateProduct}/> 
<Route path="/transactionform" component={AddTransaction}/> 
<Route path="/sellerLanding" component={SellerLanding}/> 
<Route path="/addSeller" component={AddSeller}/> 

請不要告訴我的反應.. 在此先感謝了很多:)

+0

我不知道我理解你的問題,正顯示出麪包屑,你想要什麼?如果是這種情況,你可以使用[React Breadcrumbs](https://github.com/svenanders/react-breadcrumbs) –

+0

@CésarLandesa不,我只是想在我的網站中使用站點地圖。如何使用這樣的站點地圖(在問題的例子)在我的網站與以下路線。 –

+0

https://stackoverflow.com/questions/37021438/how-to-generate-sitemap-with-react-router – paqash

回答

0

我怎麼做這件事例如

<Route path="/" component={Home}/> 
 
<Route path="/cars" component={CarList}/> 
 
<Route path="/cars/:id" component={CarDetail}/>

孟買部分,其他的過濾器,您可以向您的物品,例如位置應該由卡洛斯組件來處理,我認爲

+0

是的,這將在carList組件中處理,但我如何將其添加到我的頁面? –

+0

你想讓我編寫你的完整CarList組件嗎? :P – Borjante

+0

沒有好友:我只是想知道如何根據這些路線創建一個網站地圖 –

0
+0

是的,但它看起來有點混亂給我..你有沒有得到如何使用包? –

+0

你需要一個sitemap.xml文件還是需要在你的問題中使用Breadcrumb UI? – paqash

+0

我認爲Breadcrumb用戶界面更容易做得更好。 –