Skip to content

Commit

Permalink
fix(dd): layout prefetching (#1637)
Browse files Browse the repository at this point in the history
  • Loading branch information
Atinux committed Oct 24, 2022
1 parent 516838b commit 6463e46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/plugins/documentDriven.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ export default defineNuxtPlugin((nuxt) => {
// Prefetch layout component
const layout = layouts[layoutName]

if (layout && layout?.__asyncLoader && !layout.__asyncResolved) {
await layout.__asyncLoader()
if (layout && typeof layout === 'function') {
await layout()
}
// Apply layout
to.meta.layout = layoutName
Expand Down

0 comments on commit 6463e46

Please sign in to comment.