Answer the question
In order to leave comments, you need to log in
How to set styles for body from component/page local styles?
I want to set styles for body from component/page local styles.
Tried ::v-bind, doesn't work. Since the cache is still added.
Answer the question
In order to leave comments, you need to log in
Local styles are local, global styles are global. Vue does not include style files back and forth as components appear on the page - that would be fat as hell and computationally expensive. Styles are simply there: local (scoped) with a prefix, global without. Dynamic component styles are loaded once on the first call.
Accordingly, if you need to dynamically change styles for body
depending on the presence of a component on the page (did I understand correctly?) - do it manually: add body
a class to created
, remove to destroyed
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question