【问题标题】:How to create a site map for a website in react?如何在反应中为网站创建站点地图?
【发布时间】:2017-07-19 04:16:36
【问题描述】:

我是新来的反应我已经创建了一个网站,但现在我想创建一个这样的站点地图(从其他网站捕获)。我认为它必须通过 react-router 完成,但我仍然不确定,我不知道如何使用 react-router 来完成。

我有一个类似这样的路由器组件

<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}/>

请告诉我如何在反应中做这件事.. 提前非常感谢:)

【问题讨论】:

  • 我不确定我是否理解您的问题,是否显示面包屑您想要什么?如果是这种情况,您可以使用React Breadcrumbs
  • @CésarLandesa 不,我只想在我的网站中使用站点地图。如何在我的网站中使用这样的站点地图(在问题的示例中),路径如下。
  • @paqash 没有找到明确的答案。

标签: reactjs react-router


【解决方案1】:

例如

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

孟买部分,您可能应用于您的列表的其他过滤器(例如位置)应该由 CarList 组件处理,我认为

【讨论】:

  • 是的,这将在 carList 组件中处理,但如何将其添加到我的页面?
  • 您希望我为您的完整 CarList 组件编写代码吗? :P
  • No buddy :P 我只想知道如何根据这些路线创建站点地图
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-05-23
  • 1970-01-01
相关资源
最近更新 更多