mirror of
https://github.com/DavidHDev/vue-bits.git
synced 2026-03-07 14:39:30 -07:00
[ REFACT ] : CountUp from Animations to TextAnimations
This commit is contained in:
31
src/constants/code/TextAnimations/countUpCode.ts
Normal file
31
src/constants/code/TextAnimations/countUpCode.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import code from '@/content/TextAnimations/CountUp/CountUp.vue?raw';
|
||||
import { createCodeObject } from '@/types/code';
|
||||
|
||||
export const countup = createCodeObject(code, 'TextAnimations/CountUp', {
|
||||
usage: `<template>
|
||||
<CountUp
|
||||
:from="0"
|
||||
:to="100"
|
||||
separator=","
|
||||
direction="up"
|
||||
:duration="1"
|
||||
:delay="0"
|
||||
:start-when="true"
|
||||
class-name="count-up-text"
|
||||
@start="handleStart"
|
||||
@end="handleEnd"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import CountUp from "./CountUp.vue";
|
||||
|
||||
const handleStart = () => {
|
||||
console.log("Count animation started!");
|
||||
};
|
||||
|
||||
const handleEnd = () => {
|
||||
console.log("Count animation ended!");
|
||||
};
|
||||
</script>`
|
||||
});
|
||||
Reference in New Issue
Block a user