Function: matchRoutePath()
ts
function matchRoutePath(routePath, pathname): boolean;Checks whether a pathname matches a route path (supports :param dynamic segments). 判断当前 pathname 是否匹配给定的 routePath(支持 :param 动态参数)。
Parameters
| Parameter | Type | Description |
|---|---|---|
routePath | string | Route path / 路由路径 |
pathname | string | Current pathname / 当前 pathname |
Returns
boolean
true if matched / 匹配时返回 true
Since
1.3.0