我有兩條不同的動態路線,為什么第二條動態路線不起作用(它的返回 Activities 組件應該是 Hotspots )在此先感謝 <Switch> <Route exact path ='/' component={Home} /> <Route path={`/:City/:CatName`} component={Activities} /> <Route path={`/:City/Hotspots`} component={Hotspots} /> </Switch>這是鏈接<li> <span><Link to={`/${Order.City.replace(' ', '-')}/Hotspots`}>Hotspots</Link></span> </li> <li> <span><Link to={`/${Order.City.replace(' ', '-')}/Activities`}>Activities</Link></span> </li>
多動態路由 (react-router-dom)
MMTTMM
2023-02-17 17:31:42