Closed c-schwan closed 1 month ago
Start a new pull request in StackBlitz Codeflow.
cc: @harlan-zw
Can confirm there is a bug here, something weird going on with the reactivity. The happy path works correctly /
-> /child/foo
, just not /child/foo
-> /
-> /child/foo
Any progress on this already? I'm running into the same issue. Also found @harlan-zw 's comment in another topic about this issue, with a workaround for as long as the bug still exists. Perhaps it is a good idea to post it here. This works for now:
onMounted(() => { Object.values(injectHead()._dom?.sideEffects || {}).forEach((fn) => fn()); });
Duplicate of https://github.com/nuxt/nuxt/issues/25938 which will be fixed in the next Unhead release :slightly_smiling_face:
Environment
Reproduction
https://stackblitz.com/edit/nuxt3-nested-routes-head?file=app.vue
Describe the bug
the body attributes are merged on nested routes.
<body class="scroll no-scroll">
useSafeHead({ bodyAttrs: { class: () => (scroll.value ? 'scroll' : 'no-scroll'), } })
Additional context
No response
Logs
No response