From e3f26dc635f456e90895f2df362756b2841fd579 Mon Sep 17 00:00:00 2001 From: MonsterPi13 Date: Wed, 8 Feb 2023 17:12:19 +0800 Subject: [PATCH 1/2] chore: maybe it's unnecessary to add this expression --- packages/router/src/location.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/router/src/location.ts b/packages/router/src/location.ts index 0f981b47d..05410d429 100644 --- a/packages/router/src/location.ts +++ b/packages/router/src/location.ts @@ -243,8 +243,7 @@ export function resolveRelativePath(to: string, from: string): string { fromSegments.slice(0, position).join('/') + '/' + toSegments - // ensure we use at least the last element in the toSegments - .slice(toPosition - (toPosition === toSegments.length ? 1 : 0)) + .slice(toPosition) .join('/') ) } From 0128f77f04ffe61ec0242196a6312e8ef9372835 Mon Sep 17 00:00:00 2001 From: MonsterPi13 Date: Wed, 8 Feb 2023 17:14:00 +0800 Subject: [PATCH 2/2] style: format code --- packages/router/src/location.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/router/src/location.ts b/packages/router/src/location.ts index 05410d429..a76c60be0 100644 --- a/packages/router/src/location.ts +++ b/packages/router/src/location.ts @@ -242,8 +242,6 @@ export function resolveRelativePath(to: string, from: string): string { return ( fromSegments.slice(0, position).join('/') + '/' + - toSegments - .slice(toPosition) - .join('/') + toSegments.slice(toPosition).join('/') ) }