Struggling to find the perfect way to utilize variables returned by Vue functions in CSS inline styles, specifically with the "width" style.
I have two variables that are returned to the template and can be used with the {{}} syntax, but not directly as a CSS style.
This example works smoothly:
Total Staked {{ gems }}/{{ size }} ({{
Math.round((gems / size) * 100)
}}%)
Resulting in: Total Staked 200/350 (57%)
My goal is to incorporate that dynamic percentage (57%) into a css inline style like so:
<div class="bg-black h-2 rounded-md text-white" style="width: 57%"></div>
where the width: 57% adjusts dynamically.
Using Vue 3 along with Tailwind CSS
Check out the Codepen for reference: https://codepen.io/johnwinsor/pen/RwxvdZZ
Appreciate your help! Thank you!