From: Eduardo San Martin Morote Date: Fri, 13 Sep 2024 06:27:50 +0000 (+0200) Subject: fix: mods must be added only wiht defineProperty X-Git-Tag: v4.4.5~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7dd2a1d686beecbc6883c3f9614c50aea30a5d2;p=thirdparty%2Fvuejs%2Frouter.git fix: mods must be added only wiht defineProperty --- diff --git a/packages/router/src/matcher/index.ts b/packages/router/src/matcher/index.ts index 75b6fb0c..c80c83e5 100644 --- a/packages/router/src/matcher/index.ts +++ b/packages/router/src/matcher/index.ts @@ -381,7 +381,7 @@ function paramsFromLocation( export function normalizeRouteRecord( record: RouteRecordRaw ): RouteRecordNormalized { - const normalized: RouteRecordNormalized = { + const normalized: Omit = { path: record.path, redirect: record.redirect, name: record.name, @@ -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 @@ -408,7 +409,7 @@ export function normalizeRouteRecord( value: {}, }) - return normalized + return normalized as RouteRecordNormalized } /**