NuxtN
Nuxt3y ago
4 replies
alex pixel

useHead with scripts, how set html attribute to ="true"

I have problem with the useHead composable. I need to add a script tag in vue3 which has a html attribute set to 'true', this should render as ="true" but renders as ="".
I can see that this is done intentionally https://github.com/unjs/unhead/blob/main/packages/unhead/src/utils/normalise.ts function normaliseProps line 57.
This behaviour changed from nuxt 3 rc11 to rc12 in a useHead refactor. Before that it worked as expected.
Bug? Any solution hot to get raw html in the head? App.html doesn't work anymore in nuxt3.
GitHub
△ Universal document tag manager. Tiny, adaptable and full-featured. - unhead/normalise.ts at main · unjs/unhead
unhead/normalise.ts at main · unjs/unhead
Was this page helpful?