鍍金池/ 問答/HTML5  PHP  HTML/ react中路由參數(shù)獲取不到

react中路由參數(shù)獲取不到

路由: <Route path="/datareport/:name" component={ReportIndex}></Route>;
接收: `componentWillMount(){

   document.title="名稱"+this.props.params.name;
}`

訪問:http://localhost:3000/datareport/3
為何出錯說沒有name屬性

回答
編輯回答
喜歡你

檢查是否在 ReportIndex 執(zhí)行的,

2017年8月19日 21:24