Skip to content

Commit b28aeab

Browse files
committed
feat(router): add support for relative paths
fixes #15499
1 parent 11d4fb9 commit b28aeab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/components/router/router.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ export class Router {
8989
/** Navigate to the specified URL */
9090
@Method()
9191
push(url: string, direction: RouterDirection = 'forward') {
92+
if (url.startsWith('.')) {
93+
url = (new URL(url, window.location.href)).pathname;
94+
}
9295
console.debug('[ion-router] URL pushed -> updating nav', url, direction);
9396

9497
const path = parsePath(url);

0 commit comments

Comments
 (0)