mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-12-04 03:37:27 +00:00
63df2c851e
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
23 lines
433 B
Vue
23 lines
433 B
Vue
<template>
|
|
<span>{{ number(Math.floor(tweened.number)) }}</span>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { 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: 1, number: Number(n) || 0 });
|
|
}, {
|
|
immediate: true,
|
|
});
|
|
</script>
|