我是ReactJS的新手。我想做一条可能像(dashboard/product)
的路线。怎么可能。我创建了但它不能正常工作..可以请一些帮助。
谢谢。
<div style={wrapperStyle.MainWrapper}>
<h1>Dashboard Page</h1>
<div style={wrapperStyle.leftSideMenues}>
<h1>Left Side Menues</h1>
<div>
</div>
</div>
<Router>
<Switch>
<Route path='/' exact component= {Dashboard}/>
<Route path='/dashboard/:organizationContact' component={OraganizationContacts}/>
<Route path='/dashboard/products' component={Products}/>
<Route path='/sales' component={Sales}/>
<Route path='/purchase_orders' component={PurchaseOrders}/>
<Route path='/shipment' component={Shipments}/>
<Route path='/everything' component={Everything}/>
<Route path='/reports' component={Reports}/>
<Route path='/settings' component={Settings}/>
<Route path='/logout' component={LogOut}/>
<Route component={NotFound}/>
</Switch>
</Router>
</div>
答案 0 :(得分:2)
您可以按以下方式重新排列路线:
<Route exact path='/dashboard/products' component={Products}/>
<Route exact path='/dashboard/:organizationContact' component={OraganizationContacts}/>