fix(nuxt): de-default async layout components (#30203)

This commit is contained in:
Daniel Roe 2024-12-09 10:45:45 +00:00 committed by GitHub
parent 231b7d17c3
commit bfcf80a12a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -285,7 +285,7 @@ export const layoutTemplate: NuxtTemplate = {
filename: 'layouts.mjs',
getContents ({ app }) {
const layoutsObject = genObjectFromRawEntries(Object.values(app.layouts).map(({ name, file }) => {
return [name, `defineAsyncComponent(${genDynamicImport(file)})`]
return [name, `defineAsyncComponent(${genDynamicImport(file, { interopDefault: true })})`]
}))
return [
`import { defineAsyncComponent } from 'vue'`,