While I know how to dynamically bind styles I did not find a way to change the style of an element once it is mounted.
As an example, for the component
<template>
<div>
<another-component></another-component>
</div>
</template>
<style>
.class-defined-in-another-component {
color: blue;
}
</style>
is it possible to change color
to red
in <style>
?
Note: I am specifically interested in modifying the style and not using a construction such as <span :class="{color: dynamicColor}">
, where dynamicColor
would be a computed
value. This is because this modified style will actually be applied to downstream components (<another-component>
in the example above).