Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(nuxt): augment GlobalComponents from @vue/runtime-core
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Sep 12, 2022
1 parent 8bccdf4 commit 7493a4b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/nuxt/src/components/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const componentsTypeTemplate: NuxtTemplate<ComponentsTemplateContext> = {
])

return `// Generated by components discovery
declare module 'vue' {
declare module '@vue/runtime-core' {
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/head/runtime/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { defineNuxtPlugin, useNuxtApp } from '#app'
import { appHead } from '#build/nuxt.config.mjs'

type MetaComponents = typeof Components
declare module 'vue' {
export interface GlobalComponents extends MetaComponents { }
declare module '@vue/runtime-core' {
export interface GlobalComponents extends MetaComponents {}
}

const metaMixin = {
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/pages/runtime/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import routerOptions from '#build/router.options'
// @ts-ignore
import { globalMiddleware, namedMiddleware } from '#build/middleware'

declare module 'vue' {
declare module '@vue/runtime-core' {
export interface GlobalComponents {
NuxtPage: typeof NuxtPage
/** @deprecated */
Expand Down

0 comments on commit 7493a4b

Please sign in to comment.