diff --git a/packages/client/src/router/resolveRoute.ts b/packages/client/src/router/resolveRoute.ts index c63be5763f..0bbb627016 100644 --- a/packages/client/src/router/resolveRoute.ts +++ b/packages/client/src/router/resolveRoute.ts @@ -16,14 +16,13 @@ export const resolveRoute = ( path: string, currentPath?: string, ): ResolvedRoute => { - // get only the pathname from the path const { pathname, hashAndQueries } = splitPath(path) - // resolve the route path + // calculate the route key and full path const routeKey = resolveRouteKey(pathname, currentPath) - const routeFullPath = __VUEPRESS_CLEAN_URL__ - ? routeKey - : resolveRoutePathWithExt(routeKey) + hashAndQueries + const routeFullPath = + (__VUEPRESS_CLEAN_URL__ ? routeKey : resolveRoutePathWithExt(routeKey)) + + hashAndQueries // the route not found if (!routes.value[routeKey]) {