From c7dd2a1d686beecbc6883c3f9614c50aea30a5d2 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Fri, 13 Sep 2024 08:27:50 +0200 Subject: [PATCH] fix: mods must be added only wiht defineProperty --- packages/router/src/matcher/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/router/src/matcher/index.ts b/packages/router/src/matcher/index.ts index 75b6fb0c7..c80c83e55 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 } /**