From 5b4f588cfb9dadea98bebe15e11101f153868d3d Mon Sep 17 00:00:00 2001 From: Timi Date: Fri, 16 Oct 2026 16:25:51 +0800 Subject: [PATCH] better animated number --- src/components/animated-amount/index.ts | 5 + src/components/animated-amount/index.vue | 61 ++++++++++++ src/components/animated-number/index.vue | 120 ++++++++++++++++------- src/components/center-tips/index.vue | 1 + src/components/index.ts | 3 + 5 files changed, 152 insertions(+), 38 deletions(-) create mode 100644 src/components/animated-amount/index.ts create mode 100644 src/components/animated-amount/index.vue diff --git a/src/components/animated-amount/index.ts b/src/components/animated-amount/index.ts new file mode 100644 index 0000000..11c2eed --- /dev/null +++ b/src/components/animated-amount/index.ts @@ -0,0 +1,5 @@ +import view from "./index.vue"; +import WebToolkit from "../../utils/WebToolkit"; + +export const AnimatedAmount = WebToolkit.withInstall(view); +export default AnimatedAmount; diff --git a/src/components/animated-amount/index.vue b/src/components/animated-amount/index.vue new file mode 100644 index 0000000..6a17ce9 --- /dev/null +++ b/src/components/animated-amount/index.vue @@ -0,0 +1,61 @@ + + + diff --git a/src/components/animated-number/index.vue b/src/components/animated-number/index.vue index 749278c..47c3807 100644 --- a/src/components/animated-number/index.vue +++ b/src/components/animated-number/index.vue @@ -1,5 +1,13 @@ diff --git a/src/components/center-tips/index.vue b/src/components/center-tips/index.vue index 880ad5f..084963a 100644 --- a/src/components/center-tips/index.vue +++ b/src/components/center-tips/index.vue @@ -27,6 +27,7 @@ withDefaults(defineProps<{ font-size: .875rem; text-align: center; align-items: center; + flex-direction: column; justify-content: center; } diff --git a/src/components/index.ts b/src/components/index.ts index 5c6c960..fe38266 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -12,6 +12,7 @@ import MarkdownEditor from "./markdown-editor"; import PassTimeLabel from "./passtime-label"; import ContactNumber from "./contact-number"; import AnimatedNumber from "./animated-number"; +import AnimatedAmount from "./animated-amount"; import DescriptionGrid from "./description-grid"; export default [ @@ -28,6 +29,7 @@ export default [ PassTimeLabel, ContactNumber, AnimatedNumber, + AnimatedAmount, DescriptionGrid ]; @@ -47,6 +49,7 @@ export { PassTimeLabel, ContactNumber, AnimatedNumber, + AnimatedAmount, DescriptionGrid };