Skip to content

带:id 的路由,进入getRouteName方法是好像匹配不了,直接跳过了 #124

@Sun1090

Description

@Sun1090
Image

如下图,id 的 path 匹配不上

export function getRouteName(path: RoutePath) {
  const routeEntries = Object.entries(routeMap) as [RouteKey, RoutePath][];
  const routeName = routeEntries.find(([, routePath]) => {
    console.log(path ,routePath);
    return routePath === path
  });
  console.log(path,routeName,routeEntries);

  return routeName?.[0] || null;
}
Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions