Umi: pages 文件夹下定义 test.js,/test 路由正确匹配,/test/ 路由匹配失败

Created on 3 Feb 2018  ·  5Comments  ·  Source: umijs/umi

umi route bug

期待结果:
/test/ 也应该匹配 test.js

type(bug)

Most helpful comment

All 5 comments

react-router@4 也不会自动匹配吧?

@sorryccreact-router@4 是可以自动匹配的。

umi route bug-2

你没有加上 exact,所以是模糊匹配的。

只追加 exact 依旧可以匹配。

但是如果同时 exact+strict 就不能匹配了。

我觉得 umi 现在的路由匹配规则有点像同时 exact+strict。
如果可以支持两种规则切换的话就更完美了。

react-router api

path | location.pathname | matches?
-- | -- | --
/one | /one | yes
/one | /one/ | no
/one | /one/two | no

umi route bug-3

Was this page helpful?
0 / 5 - 0 ratings

Related issues

miaojinxing picture miaojinxing  ·  3Comments

stoneWeb picture stoneWeb  ·  3Comments

tangzhengwen picture tangzhengwen  ·  4Comments

nguyenhuutinh picture nguyenhuutinh  ·  3Comments

kitebear picture kitebear  ·  3Comments