From b0bf8b55fc740bd9c018be02297db10a592b82dd Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 5 Sep 2024 08:33:07 +0100 Subject: [PATCH] fix(nuxt): ensure injected `route` has enumerable keys (#28841) --- packages/nuxt/src/app/components/route-provider.ts | 1 + packages/nuxt/src/pages/runtime/plugins/router.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/nuxt/src/app/components/route-provider.ts b/packages/nuxt/src/app/components/route-provider.ts index 3f81d028a9..16ac724bc7 100644 --- a/packages/nuxt/src/app/components/route-provider.ts +++ b/packages/nuxt/src/app/components/route-provider.ts @@ -27,6 +27,7 @@ export const RouteProvider = defineComponent({ for (const key in props.route) { Object.defineProperty(route, key, { get: () => previousKey === props.renderKey ? props.route[key as keyof RouteLocationNormalizedLoaded] : previousRoute[key as keyof RouteLocationNormalizedLoaded], + enumerable: true, }) } diff --git a/packages/nuxt/src/pages/runtime/plugins/router.ts b/packages/nuxt/src/pages/runtime/plugins/router.ts index 38bd3a4d39..7f2e5faca6 100644 --- a/packages/nuxt/src/pages/runtime/plugins/router.ts +++ b/packages/nuxt/src/pages/runtime/plugins/router.ts @@ -122,6 +122,7 @@ const plugin: Plugin<{ router: Router }> = defineNuxtPlugin({ for (const key in _route.value) { Object.defineProperty(route, key, { get: () => _route.value[key as keyof RouteLocation], + enumerable: true, }) }