Closed eybarta closed 6 years ago
<template v-if="subtotal % 1 === 0">
<count-up ... :decimals="0" ... />
</template>
<template v-else>
<count-up ... :decimals="2" ... />
</template>
When the property changes, you didn't re-render it, which is really bad. My current solution is to randomly generate a key and let vue automatically re-render, which causes the performance of the page to drop.
Thank you for your contribution. Thanks
Hi, great plugin, thanks!
I wanted to use 2 decimals in case my number is a float and 0 decimals in case my number is whole to avoid having numbers like this for example: 1542.00
so I tried as prop on component: <count-up ... :decimals="subtotal % 1 != 0 ? 2 : 0" ... />
and it doesn't work as needed..
could you please let me know how to accomplish what I need?
thx!