This commit is contained in:
Julien Huang 2025-01-11 17:33:27 +01:00
parent f22ef4f137
commit b14f3dc2d5

View File

@ -160,9 +160,9 @@ function nuxt2Shims (nuxt: Nuxt) {
nuxt.hooks = nuxt
// Allow using useNuxt()
if (!nuxtCtx.tryUse()) {
nuxtCtx.set(nuxt)
nuxt.hook('close', () => nuxtCtx.unset())
if (!nuxtCtx().tryUse()) {
nuxtCtx().set(nuxt)
nuxt.hook('close', () => nuxtCtx().unset())
}
// Support virtual templates with getContents() by writing them to .nuxt directory