Umi: 动态路由 如何获取路由参数

Created on 27 Jul 2018  ·  3Comments  ·  Source: umijs/umi

route : "path": "/business/:id?/:test"

如何 获取id 跟test的参数值

Most helpful comment

match.params.idmatch.params.test,参考 https://reacttraining.com/react-router/web/example/url-params

All 3 comments

match.params.idmatch.params.test,参考 https://reacttraining.com/react-router/web/example/url-params

match 和computedMatch差别是啥呢?

match 和computedMatch差别是啥呢?

@lehug computedMatch 其实是个内部属性,在 Switch 和 Route 之间用到,公开的 API 参数要用 match。

computedMatch会触发开发版本 React 的unknown prop⚠️。

Was this page helpful?
0 / 5 - 0 ratings

Related issues

liuxinqiong picture liuxinqiong  ·  3Comments

haiing picture haiing  ·  3Comments

sorrycc picture sorrycc  ·  4Comments

tauruswang picture tauruswang  ·  3Comments

ddzy picture ddzy  ·  3Comments