Skip to content

Commit

Permalink
fix: mods must be added only wiht defineProperty
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Sep 13, 2024
1 parent a8df616 commit c7dd2a1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/router/src/matcher/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ function paramsFromLocation(
export function normalizeRouteRecord(
record: RouteRecordRaw
): RouteRecordNormalized {
const normalized: RouteRecordNormalized = {
const normalized: Omit<RouteRecordNormalized, 'mods'> = {
path: record.path,
redirect: record.redirect,
name: record.name,
Expand All @@ -394,7 +394,8 @@ export function normalizeRouteRecord(
leaveGuards: new Set(),
updateGuards: new Set(),
enterCallbacks: {},
mods: {},
// must be declared afterwards
// mods: {},
components:
'components' in record
? record.components || null
Expand All @@ -408,7 +409,7 @@ export function normalizeRouteRecord(
value: {},
})

return normalized
return normalized as RouteRecordNormalized
}

/**
Expand Down

0 comments on commit c7dd2a1

Please sign in to comment.