From 11ee3c92b9f6ac6074697bdaa486006406e7712c Mon Sep 17 00:00:00 2001 From: Emil Rosenius Date: Mon, 20 Mar 2023 00:22:55 +0100 Subject: [PATCH] fix(nuxt): add temporary augmentation for webstorm (and docs) (#19400) Co-authored-by: Daniel Roe --- docs/2.guide/2.directory-structure/1.plugins.md | 4 ++++ packages/nuxt/src/core/templates.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/2.guide/2.directory-structure/1.plugins.md b/docs/2.guide/2.directory-structure/1.plugins.md index 544b7dec9b..b24ef8a0dd 100644 --- a/docs/2.guide/2.directory-structure/1.plugins.md +++ b/docs/2.guide/2.directory-structure/1.plugins.md @@ -133,6 +133,10 @@ declare module 'vue' { export { } ``` +::alert{type=warning} +If you are using WebStorm, you may need to augment `@vue/runtime-core` until [this issue](https://youtrack.jetbrains.com/issue/WEB-59818/VUE-Typescript-WS-PS-does-not-correctly-display-type-of-globally-injected-properties) is resolved. +:: + ## Vue Plugins If you want to use Vue plugins, like [vue-gtag](https://github.com/MatteoGabriele/vue-gtag) to add Google Analytics tags, you can use a Nuxt plugin to do so. diff --git a/packages/nuxt/src/core/templates.ts b/packages/nuxt/src/core/templates.ts index 5c83133aa5..bef450ed9f 100644 --- a/packages/nuxt/src/core/templates.ts +++ b/packages/nuxt/src/core/templates.ts @@ -106,6 +106,10 @@ declare module '#app' { declare module 'vue' { interface ComponentCustomProperties extends NuxtAppInjections { } } +// TODO: remove when webstorm has support for augumenting 'vue' directly +declare module '@vue/runtime-core' { + interface ComponentCustomProperties extends NuxtAppInjections { } +} export { } `