React路由使用
NavLink 的使用:
<NavLink to="/" className="nav-item" exact activeClassName="nav-active">Main
</NavLink>
路由使用
render() {return (<BrowserRouter><Nav />{/* <div className="container">hello,Dust.--App-index</div> */}<Switch><Route path='/' exact component={Main}></Route><Route path='/put' component={Put}></Route><Route path='/open' component={Open}></Route><Route component={NotFound} /></Switch></BrowserRouter>)}
總結
- 上一篇: react控制 input 框回车之后内
- 下一篇: CSS Modules