Make sure to strip away the {}
from the styling value and eliminate the quotes '
:
<ComponentA style="border:1px solid red" />
Alternatively, you can include the binding indicator :
:
<ComponentA :style="{'border':'1px solid red'}" />
An essential point to remember is that when applying attributes to components, the attribute will be attached to the main element of that component (the first following child element).
When applied to a component:
<ComponentA class="tab" style="border:1px solid red" />
It translates to this on the primary element:
<div class="tab" style="border:1px solid red">Component A</div>
If the component comprises multiple primary elements, then it's necessary to specify which one should receive the data:
<ComponentA class="tab" />
<div :class="$atrr.class">Component A</div>
<div>Second root element</div>
For more information, visit: https://vuejs.org/guide/essentials/class-and-style.html#with-components