mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-11-15 20:06:54 +01:00
24 lines
439 B
Vue
24 lines
439 B
Vue
|
<template>
|
||
|
<span>{{ number(tweened.number.toFixed(0)) }}</span>
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts" setup>
|
||
|
import { ref, reactive, watch } from 'vue';
|
||
|
import gsap from 'gsap';
|
||
|
import number from '@/filters/number';
|
||
|
|
||
|
const props = defineProps<{
|
||
|
value: number;
|
||
|
}>();
|
||
|
|
||
|
const tweened = reactive({
|
||
|
number: 0,
|
||
|
});
|
||
|
|
||
|
watch(() => props.value, (n) => {
|
||
|
gsap.to(tweened, { duration: 0.5, number: Number(n) || 0 });
|
||
|
}, {
|
||
|
immediate: true,
|
||
|
});
|
||
|
</script>
|