Use @assing value in HTML style attribute

Hi!

I am trying to use an assign value in a style attribute, something like:

<div style="color: item.color">
</div>

What I have already tried:

<div style={color: item.color}>
</div>
<div style={"color": item.color}>
</div>
<div style=[color: item.color]>
</div>
<div style={%{color: item.color}}>
</div>

Nothing works.

It this supported?

Thanks!

1 minute later I found the correct way after finding this post: Concat string wit attributes in html attributes

<div style={"color: #{item.color}"}>
</div>
2 Likes