feat(nuxt3): allow overriding root component using app.root.vue (#3733)

This commit is contained in:
pooya parsa 2022-03-17 11:57:02 +01:00 committed by GitHub
parent fb150825ce
commit 91fd16ae52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,8 +63,10 @@ export async function resolveApp (nuxt: Nuxt, app: NuxtApp) {
app.mainComponent = tryResolveModule('@nuxt/ui-templates/templates/welcome.vue') app.mainComponent = tryResolveModule('@nuxt/ui-templates/templates/welcome.vue')
} }
// Default root component // Resolve root component
app.rootComponent = resolve(nuxt.options.appDir, 'components/nuxt-root.vue') if (!app.rootComponent) {
app.rootComponent = await findPath(['~/app.root', resolve(nuxt.options.appDir, 'components/nuxt-root.vue')])
}
// Resolve error component // Resolve error component
if (!app.errorComponent) { if (!app.errorComponent) {