Skip to content

Commit 2b77a53

Browse files
committed
chore: tweak
1 parent da2436d commit 2b77a53

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

packages/client/src/router/createVueRouter.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ export const createVueRouter = (): Router => {
4040
// and save page data to route meta
4141
router.beforeResolve(async (to, from): Promise<string | void> => {
4242
if (to.path !== from.path || from === START_LOCATION) {
43-
const fullPath = to.fullPath.split(/#|\?/)[0]
44-
const route = resolveRoute(fullPath)
45-
46-
if (route.path !== fullPath) {
43+
const route = resolveRoute(to.fullPath)
44+
if (route.path !== to.fullPath) {
4745
return route.path
4846
}
4947
const pageChunk = await route.loader()

packages/client/src/router/resolveRoute.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export const resolveRoute = <T extends RouteMeta = RouteMeta>(
1616
currentPath?: string,
1717
): ResolvedRoute<T> => {
1818
const routePath = resolveRoutePath(path, currentPath)
19-
const route = routes.value[routePath] ?? {
19+
const pathname = routePath.split(/#|\?/)[0]
20+
const route = routes.value[pathname] ?? {
2021
...routes.value['/404.html'],
2122
notFound: true,
2223
}

0 commit comments

Comments
 (0)