Skip to content

Commit

Permalink
fix(nuxt): augment interfaces exported from vue (#18505)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jan 25, 2023
1 parent 026511b commit 7d812db
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/2.guide/2.directory-structure/1.plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ declare module '#app' {
}
}

declare module '@vue/runtime-core' {
declare module 'vue' {
interface ComponentCustomProperties {
$hello (msg: string): string
}
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/types/augments.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ declare global {
}
}

declare module '@vue/runtime-core' {
declare module 'vue' {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface App<HostElement> {
$nuxt: NuxtApp
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/components/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const componentsTypeTemplate: NuxtTemplate<ComponentsTemplateContext> = {
])

return `// Generated by components discovery
declare module '@vue/runtime-core' {
declare module 'vue' {
export interface GlobalComponents {
${componentTypes.map(([pascalName, type]) => ` '${pascalName}': ${type}`).join('\n')}
${componentTypes.map(([pascalName, type]) => ` 'Lazy${pascalName}': ${type}`).join('\n')}
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/src/core/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const vueShim: NuxtTemplate = {
getContents: () =>
[
'declare module \'*.vue\' {',
' import { DefineComponent } from \'@vue/runtime-core\'',
' import { DefineComponent } from \'vue\'',
' const component: DefineComponent<{}, {}, any>',
' export default component',
'}'
Expand Down Expand Up @@ -102,7 +102,7 @@ declare module '#app' {
interface NuxtApp extends NuxtAppInjections { }
}
declare module '@vue/runtime-core' {
declare module 'vue' {
interface ComponentCustomProperties extends NuxtAppInjections { }
}
Expand Down

0 comments on commit 7d812db

Please sign in to comment.