Skip to content

Commit a26ce6a

Browse files
committed
fix: relative locations fullPath
1 parent 282cd9b commit a26ce6a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/router/src/experimental/route-resolver/resolver-fixed.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ describe('fixed resolver', () => {
168168
).toMatchObject({
169169
params: {},
170170
path: '/nested/foo',
171+
fullPath: '/nested/foo',
171172
query: {},
172173
hash: '',
173174
})
@@ -179,6 +180,7 @@ describe('fixed resolver', () => {
179180
).toMatchObject({
180181
params: {},
181182
path: '/foo',
183+
fullPath: '/foo',
182184
query: {},
183185
hash: '',
184186
})
@@ -190,6 +192,7 @@ describe('fixed resolver', () => {
190192
).toMatchObject({
191193
params: {},
192194
path: '/nested/foo',
195+
fullPath: '/nested/foo',
193196
query: {},
194197
hash: '',
195198
})

packages/router/src/experimental/route-resolver/resolver-fixed.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,10 @@ export function createFixedResolver<
224224
url = parseURL(parseQuery, to, currentLocation?.path)
225225
} else {
226226
const query = normalizeQuery(to.query)
227+
const path = resolveRelativePath(to.path, currentLocation?.path || '/')
227228
url = {
228-
fullPath: NEW_stringifyURL(stringifyQuery, to.path, query, to.hash),
229-
path: resolveRelativePath(to.path, currentLocation?.path || '/'),
229+
fullPath: NEW_stringifyURL(stringifyQuery, path, query, to.hash),
230+
path,
230231
query,
231232
hash: to.hash || '',
232233
}

0 commit comments

Comments
 (0)