d3george / slash-admin

A modern react admin. It is based on react 18, vite and TypeScript. It's fast !
https://admin.slashspaces.com/
MIT License
1.49k stars 218 forks source link

这种形式的路由 /article/:articleId 支持有些问题 #28

Closed wotermelon closed 5 months ago

wotermelon commented 7 months ago

src/router/hooks/use-match-route-meta.tsx

const currentRouteMeta = flattenedRoutes.find(
      (item) => item.key === lastRoute?.pathname || `${item.key}/` === lastRoute?.pathname,
    );
    if (currentRouteMeta) {
      if (!currentRouteMeta.hideTab) {
        currentRouteMeta.outlet = children;
        setMatchRouteMeta(currentRouteMeta);
      }
    } else {
      push(HOMEPAGE);
    }

lastRoute?.pathname => /article/123 key: '/article/:articleId' !== '/article/123'

导致这种形式的路由会一直跳HOMEPAGE

d3george commented 7 months ago

你可以尝试处理下这个bug