fix(nuxt): add temporary augmentation for webstorm (and docs) (#19400)

Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
Emil Rosenius 2023-03-20 00:22:55 +01:00 committed by GitHub
parent 3055ce35b1
commit 11ee3c92b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -133,6 +133,10 @@ declare module 'vue' {
export { } 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 ## 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. 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.

View File

@ -106,6 +106,10 @@ declare module '#app' {
declare module 'vue' { declare module 'vue' {
interface ComponentCustomProperties extends NuxtAppInjections { } interface ComponentCustomProperties extends NuxtAppInjections { }
} }
// TODO: remove when webstorm has support for augumenting 'vue' directly
declare module '@vue/runtime-core' {
interface ComponentCustomProperties extends NuxtAppInjections { }
}
export { } export { }
` `