
期待结果:
/test/ 也应该匹配 test.js
用 react-router@4 也不会自动匹配吧?
@sorrycc 用 react-router@4 是可以自动匹配的。

你没有加上 exact,所以是模糊匹配的。
只追加 exact 依旧可以匹配。
但是如果同时 exact+strict 就不能匹配了。
我觉得 umi 现在的路由匹配规则有点像同时 exact+strict。
如果可以支持两种规则切换的话就更完美了。
path | location.pathname | matches?
-- | -- | --
/one | /one | yes
/one | /one/ | no
/one | /one/two | no

Most helpful comment