mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 17:07:22 +00:00
fix(nuxt): augment interfaces exported from vue
(#18505)
This commit is contained in:
parent
026511b697
commit
7d812db9e8
@ -124,7 +124,7 @@ declare module '#app' {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@vue/runtime-core' {
|
declare module 'vue' {
|
||||||
interface ComponentCustomProperties {
|
interface ComponentCustomProperties {
|
||||||
$hello (msg: string): string
|
$hello (msg: string): string
|
||||||
}
|
}
|
||||||
|
2
packages/nuxt/src/app/types/augments.d.ts
vendored
2
packages/nuxt/src/app/types/augments.d.ts
vendored
@ -17,7 +17,7 @@ declare global {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@vue/runtime-core' {
|
declare module 'vue' {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
interface App<HostElement> {
|
interface App<HostElement> {
|
||||||
$nuxt: NuxtApp
|
$nuxt: NuxtApp
|
||||||
|
@ -114,7 +114,7 @@ export const componentsTypeTemplate: NuxtTemplate<ComponentsTemplateContext> = {
|
|||||||
])
|
])
|
||||||
|
|
||||||
return `// Generated by components discovery
|
return `// Generated by components discovery
|
||||||
declare module '@vue/runtime-core' {
|
declare module 'vue' {
|
||||||
export interface GlobalComponents {
|
export interface GlobalComponents {
|
||||||
${componentTypes.map(([pascalName, type]) => ` '${pascalName}': ${type}`).join('\n')}
|
${componentTypes.map(([pascalName, type]) => ` '${pascalName}': ${type}`).join('\n')}
|
||||||
${componentTypes.map(([pascalName, type]) => ` 'Lazy${pascalName}': ${type}`).join('\n')}
|
${componentTypes.map(([pascalName, type]) => ` 'Lazy${pascalName}': ${type}`).join('\n')}
|
||||||
|
@ -17,7 +17,7 @@ export const vueShim: NuxtTemplate = {
|
|||||||
getContents: () =>
|
getContents: () =>
|
||||||
[
|
[
|
||||||
'declare module \'*.vue\' {',
|
'declare module \'*.vue\' {',
|
||||||
' import { DefineComponent } from \'@vue/runtime-core\'',
|
' import { DefineComponent } from \'vue\'',
|
||||||
' const component: DefineComponent<{}, {}, any>',
|
' const component: DefineComponent<{}, {}, any>',
|
||||||
' export default component',
|
' export default component',
|
||||||
'}'
|
'}'
|
||||||
@ -102,7 +102,7 @@ declare module '#app' {
|
|||||||
interface NuxtApp extends NuxtAppInjections { }
|
interface NuxtApp extends NuxtAppInjections { }
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@vue/runtime-core' {
|
declare module 'vue' {
|
||||||
interface ComponentCustomProperties extends NuxtAppInjections { }
|
interface ComponentCustomProperties extends NuxtAppInjections { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user