编程式导航
摘要:react-router-dom中通过history对象中的push/replace/go等方法实现编程式导航功能 this.props.history.push(path) 或 this.props.history.push({ pathname:’’, search:’’, state:{} }
阅读全文
posted @
2021-05-31 12:56
Tsunami黄嵩粟
阅读(90)
推荐(0) 编辑
react路由渲染
摘要:三种渲染方式 component = (组件对象或函数) <Route path="/home" component={Home} /> 或 <Route path="/home" component={()=><Home />} /> render = (函数) <Route path="/hom
阅读全文
posted @
2021-05-31 12:55
Tsunami黄嵩粟
阅读(141)
推荐(0) 编辑