V
V
Vladimir Golub2021-05-20 14:14:48
Vue.js
Vladimir Golub, 2021-05-20 14:14:48

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

1 answer(s)
A
Aetae, 2021-05-20
@RazerVG

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 bodydepending on the presence of a component on the page (did I understand correctly?) - do it manually: add bodya class to created, remove to destroyed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question