I'm using Vue 3 composition API. I have a toggle that dynamically loads a component (using <component :is="MyComponent">) that includes the vue-animated-number component. The first time I load the component, the animation plays fine. However, when I toggle out of the component and back to the component, the vue-animated-number value stays at 0 and does not replay. It works fine in Safari. The custom component uses a pretty standard configuration for vue-animated-number:
<script setup>
import NumberAnimation from 'vue-number-animation';
defineProps(['value']);
function format(num) {
const formatter = new Intl.NumberFormat('en-US');
return formatter.format(Number.parseInt(num).toFixed(0));
}
</script>
<template>
<NumberAnimation :to="value" :format="format" :duration="0.3" />
</template>
I was hoping others might have come across this issue.
I guess the issue might have to do with setting the duration to 0.3. This works fine when the duration prop is not set (albeit a 1 second animation is not desirable).
I'm using Vue 3 composition API. I have a toggle that dynamically loads a component (using
<component :is="MyComponent">
) that includes thevue-animated-number
component. The first time I load the component, the animation plays fine. However, when I toggle out of the component and back to the component, thevue-animated-number
value stays at 0 and does not replay. It works fine in Safari. The custom component uses a pretty standard configuration forvue-animated-number
:I was hoping others might have come across this issue.