mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-21 16:09:52 +00:00
fix(nuxt): check for layout after nextTick
(#25197)
This commit is contained in:
parent
3f4dfb39da
commit
49d4ae6112
@ -1,3 +1,4 @@
|
|||||||
|
import { nextTick } from 'vue'
|
||||||
import { defineNuxtPlugin } from '../nuxt'
|
import { defineNuxtPlugin } from '../nuxt'
|
||||||
import { onNuxtReady } from '../composables/ready'
|
import { onNuxtReady } from '../composables/ready'
|
||||||
import { useError } from '../composables/error'
|
import { useError } from '../composables/error'
|
||||||
@ -16,7 +17,7 @@ export default defineNuxtPlugin({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (import.meta.server) {
|
if (import.meta.server) {
|
||||||
nuxtApp.hook('app:rendered', checkIfLayoutUsed)
|
nuxtApp.hook('app:rendered', () => { nextTick(checkIfLayoutUsed) })
|
||||||
} else {
|
} else {
|
||||||
onNuxtReady(checkIfLayoutUsed)
|
onNuxtReady(checkIfLayoutUsed)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user