From 5132ef8c81d61727f791f5100f2b5eff5984867a Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 8 Aug 2024 09:49:11 +0100 Subject: [PATCH] fix(nuxt): augment `@vue/runtime-core` and `@vue/runtime-dom` (#28446) --- packages/nuxt/src/app/types/augments.d.ts | 20 ++++++++++++++++++++ packages/nuxt/src/core/templates.ts | 8 ++++++++ 2 files changed, 28 insertions(+) diff --git a/packages/nuxt/src/app/types/augments.d.ts b/packages/nuxt/src/app/types/augments.d.ts index 3717d48d0c..d57e80d0a5 100644 --- a/packages/nuxt/src/app/types/augments.d.ts +++ b/packages/nuxt/src/app/types/augments.d.ts @@ -51,3 +51,23 @@ declare module 'vue' { head?(nuxtApp: NuxtApp): UseHeadInput } } + +declare module '@vue/runtime-core' { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + interface App { + $nuxt: NuxtApp + } + interface ComponentCustomProperties { + $nuxt: NuxtApp + } +} + +declare module '@vue/runtime-dom' { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + interface App { + $nuxt: NuxtApp + } + interface ComponentCustomProperties { + $nuxt: NuxtApp + } +} diff --git a/packages/nuxt/src/core/templates.ts b/packages/nuxt/src/core/templates.ts index d1ba1e4682..859d4ae6a9 100644 --- a/packages/nuxt/src/core/templates.ts +++ b/packages/nuxt/src/core/templates.ts @@ -144,6 +144,14 @@ declare module '#app' { } } +declare module '@vue/runtime-core' { + interface ComponentCustomProperties extends NuxtAppInjections { } +} + +declare module '@vue/runtime-dom' { + interface ComponentCustomProperties extends NuxtAppInjections { } +} + declare module 'vue' { interface ComponentCustomProperties extends NuxtAppInjections { } }