Subscribe on changes!

Reactive computed classes disappear when using style modules

avatar
Jan 11th 2024

Vue version

3.4.0-3.4.8

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-zli3s1?file=src%2FApp.vue&terminal=dev

Steps to reproduce

Click on input

What is expected?

Class "_focused" is applied to msg.

What is actually happening?

All computed classes disappear from msg

System Info

No response

Any additional comments?

If you install vue@3.3.13 logic works as intended

avatar
Jan 11th 2024

You should use useCssModule directly under the setup scope, extracting the $style outside to the setup scope should work

avatar
Jan 11th 2024

That fixed it, thanks!