no message
This commit is contained in:
+12
-7
@@ -15,7 +15,7 @@ class App extends Component{
|
||||
<div className='mainContainer'>
|
||||
<div className='nav'>
|
||||
<NavLink to='/about' children="About"/>
|
||||
<NavLink to='/home' activeClassName='active'>Home</NavLink>
|
||||
<NavLink to='/home' activeclassname='active'>Home</NavLink>
|
||||
<NavLink to='/ref'>ref</NavLink>
|
||||
<NavLink to='/props'>props</NavLink>
|
||||
<NavLink to='/life'>生命周期函数</NavLink>
|
||||
@@ -23,12 +23,17 @@ class App extends Component{
|
||||
<div className='content'>
|
||||
<Head/>
|
||||
<Routes>
|
||||
{
|
||||
routes.map((i)=>{
|
||||
return <Route path={i.path} element={i.component} key={i.path}></Route>
|
||||
})
|
||||
}
|
||||
</Routes>
|
||||
{routes.map((item, index) => {
|
||||
return (
|
||||
<Route
|
||||
key={index}
|
||||
exact
|
||||
path={item.path}
|
||||
element={<item.component />}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</Routes>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user