Blazetrail
Blazetrail
NNuxt
Created by Blazetrail on 4/2/2024 in #❓・help
Check whether any page has fully mounted from the root App.vue
Some of my pages have a
definePageMeta({ hideSidebar: true })
definePageMeta({ hideSidebar: true })
which sets the hideSidebar property in the pinia store to true or false the way it works currently is, in App.vue I have this code
// app.vue
const appStore = useAppStore()

nuxtApp.hook('page:finish', () => {
appStore.hideSidebar = !!route.meta.hideSidebar
})
// app.vue
const appStore = useAppStore()

nuxtApp.hook('page:finish', () => {
appStore.hideSidebar = !!route.meta.hideSidebar
})
However this causes flickers, for example when I reload the page, for a millisecond I see the sidebar flickering. I've tried with different nuxt hooks instead of page:finish but none seemed to work fine. What would you suggest ?
5 replies