mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 07:32:01 +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 {
|
||||
$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
|
||||
interface App<HostElement> {
|
||||
$nuxt: NuxtApp
|
||||
|
@ -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')}
|
||||
|
@ -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',
|
||||
'}'
|
||||
@ -102,7 +102,7 @@ declare module '#app' {
|
||||
interface NuxtApp extends NuxtAppInjections { }
|
||||
}
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
declare module 'vue' {
|
||||
interface ComponentCustomProperties extends NuxtAppInjections { }
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user