React 學習筆記 (八)(react-router 4. x 頁面傳值)

動態路由傳值 1.配置(根組件加載組件,注意path寫法: /xxx/:id)react <Route path='/product/:id' component={RouterProduct}></Route> 2.跳轉(注意寫法:es6 模板字符串 鍵盤esc下面的按鈕 不是單引號)es6 <Link to={`/product/${val.id}`}>{val.title}</Link> 3
相關文章
相關標籤/搜索