6
6
<div class =" demo-container relative" >
7
7
<CountUp
8
8
:key =" keyDefault"
9
- :from =" 0 "
10
- :to =" 100 "
11
- separator = " , "
12
- direction = " up "
13
- :duration =" 1 "
9
+ :from =" from "
10
+ :to =" to "
11
+ :direction = " direction "
12
+ :delay = " delay "
13
+ :duration =" duration "
14
14
class-name =" count-up-text"
15
15
/>
16
16
17
17
<RefreshButton @click =" forceRerenderDefault" />
18
18
</div >
19
19
20
- <h2 class =" demo-title-extra" >Start Programatically </h2 >
20
+ <h2 class =" demo-title-extra" >Start Programmatically </h2 >
21
21
22
22
<div class =" demo-container flex flex-col justify-center items-center relative min-h-[200px]" >
23
23
<button
28
28
</button >
29
29
30
30
<CountUp
31
- :key =" keyProgramatically "
31
+ :key =" keyProgrammatically "
32
32
:from =" 100"
33
33
:to =" 500"
34
34
:start-when =" startCounting"
35
35
:duration =" 5"
36
36
class-name =" count-up-text"
37
37
/>
38
38
39
- <RefreshButton v-if =" startCounting" @click =" forceRerenderProgramatically " />
39
+ <RefreshButton v-if =" startCounting" @click =" forceRerenderProgrammatically " />
40
40
</div >
41
41
42
+ <Customize >
43
+ <PreviewSlider title =" From" v-model =" from" :min =" 0" :max =" 100" :step =" 10" />
44
+
45
+ <PreviewSlider title =" To" v-model =" to" :min =" 100" :max =" 500" :step =" 100" />
46
+
47
+ <PreviewSelect title =" Direction" v-model =" direction" :options =" directionOptions" />
48
+
49
+ <PreviewSlider title =" Duration" v-model =" duration" :min =" 0.5" :max =" 10" :step =" 0.5" value-unit =" s" />
50
+
51
+ <PreviewSlider title =" Delay" v-model =" delay" :min =" 0" :max =" 5" :step =" 0.5" value-unit =" s" />
52
+ </Customize >
53
+
42
54
<PropTable :data =" propData" />
43
55
</template >
44
56
@@ -62,19 +74,33 @@ import RefreshButton from '../../components/common/RefreshButton.vue';
62
74
import CountUp from ' ../../content/Animations/CountUp/CountUp.vue' ;
63
75
import { countup } from ' @/constants/code/Animations/countUpCode' ;
64
76
import { useForceRerender } from ' @/composables/useForceRerender' ;
77
+ import Customize from ' ../../components/common/Customize.vue' ;
78
+ import PreviewSlider from ' ../../components/common/PreviewSlider.vue' ;
79
+ import PreviewSelect from ' ../../components/common/PreviewSelect.vue' ;
65
80
66
81
const startCounting = ref (false );
67
82
68
83
const { rerenderKey : keyDefault, forceRerender : forceRerenderDefault } = useForceRerender ();
69
- const { rerenderKey : keyProgramatically , forceRerender : forceRerenderProgramatically } = useForceRerender ();
84
+ const { rerenderKey : keyProgrammatically , forceRerender : forceRerenderProgrammatically } = useForceRerender ();
70
85
71
86
const setStartCounting = (value : boolean ) => {
72
87
startCounting .value = value ;
73
88
if (value ) {
74
- forceRerenderProgramatically ();
89
+ forceRerenderProgrammatically ();
75
90
}
76
91
};
77
92
93
+ const from = ref (50 );
94
+ const to = ref (100 );
95
+ const direction = ref <' up' | ' down' >(' up' );
96
+ const duration = ref (2 );
97
+ const delay = ref (0 );
98
+
99
+ const directionOptions = [
100
+ { label: ' Up' , value: ' up' },
101
+ { label: ' Down' , value: ' down' }
102
+ ];
103
+
78
104
const propData = [
79
105
{
80
106
name: ' to' ,
0 commit comments