fix(nuxt): augment GlobalComponents from @vue/runtime-core (#7448)

This commit is contained in:
Daniel Roe 2022-09-12 14:40:44 +01:00 committed by GitHub
parent 8bccdf44e8
commit 5893dc201f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -79,7 +79,7 @@ export const componentsTypeTemplate: NuxtTemplate<ComponentsTemplateContext> = {
]) ])
return `// Generated by components discovery return `// Generated by components discovery
declare module 'vue' { declare module '@vue/runtime-core' {
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')}

View File

@ -6,8 +6,8 @@ import { defineNuxtPlugin, useNuxtApp } from '#app'
import { appHead } from '#build/nuxt.config.mjs' import { appHead } from '#build/nuxt.config.mjs'
type MetaComponents = typeof Components type MetaComponents = typeof Components
declare module 'vue' { declare module '@vue/runtime-core' {
export interface GlobalComponents extends MetaComponents { } export interface GlobalComponents extends MetaComponents {}
} }
const metaMixin = { const metaMixin = {

View File

@ -18,7 +18,7 @@ import routerOptions from '#build/router.options'
// @ts-ignore // @ts-ignore
import { globalMiddleware, namedMiddleware } from '#build/middleware' import { globalMiddleware, namedMiddleware } from '#build/middleware'
declare module 'vue' { declare module '@vue/runtime-core' {
export interface GlobalComponents { export interface GlobalComponents {
NuxtPage: typeof NuxtPage NuxtPage: typeof NuxtPage
/** @deprecated */ /** @deprecated */