Skip to content

Commit

Permalink
fix: avoid unexpected slash in route path (#6760)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClarkXia authored Jan 24, 2024
1 parent d362b8a commit c1aab10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/red-walls-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ice/runtime': patch
---

fix: avoid unexpected slash in route path
2 changes: 1 addition & 1 deletion packages/runtime/src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function getRoutesPath(routes: RouteItem[], parentPath = ''): string[] {
let paths = [];

routes.forEach((route) => {
const pathId = `${parentPath}/${route.path || ''}`;
const pathId = `${parentPath}/${route.path || ''}`.replace('//', '/');
if (route.children) {
paths.push(...getRoutesPath(route.children, pathId));
} else {
Expand Down

0 comments on commit c1aab10

Please sign in to comment.