Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Reactively add/remove a class name to <body>, from within a component... - Nuxt
N
Nuxt
•
2y ago
•
44 replies
deetstrab
Reactively add/remove a class name to <body>, from within a component...
I have a component with a boolean ref
. As long as
myBool.value === true
myBool.value === true
, I
'd like to bind a class name to
<body>
<body>
.
I
've attempted to use the
useMeta
useMeta
and
useMetaSafe
useMetaSafe
composables
(useHead
> bodyAttrs
.class
) but it doesn
't change reactively
.
Any idea what the heck I
'm missing
? This is driving me nuts and the documentation makes it sound relatively simple
.
Nuxt
Join
Nuxt Community Chat Server
31,686
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
How to dynamically set body class?
N
Nuxt / ❓・help
4y ago
How to prevent duplicate API endpoint calls being made from within a component?
N
Nuxt / ❓・help
11mo ago
Modify file generated from `nuxt add component`
N
Nuxt / ❓・help
17mo ago