vben
authored
|
1
|
<template>
|
vben
authored
|
2
|
<PageWrapper title="数字动画示例">
|
vben
authored
|
3
4
|
<Card>
<CardGrid class="count-to-demo-card">
|
|
5
|
<CountTo prefix="$" :color="'#409EFF'" :startVal="1" :endVal="200000" :duration="8000" />
|
vben
authored
|
6
7
|
</CardGrid>
<CardGrid class="count-to-demo-card">
|
|
8
9
10
11
12
13
14
15
|
<CountTo
suffix="$"
:color="'red'"
:startVal="1"
:endVal="300000"
:decimals="2"
:duration="6000"
/>
|
vben
authored
|
16
17
|
</CardGrid>
<CardGrid class="count-to-demo-card">
|
|
18
19
20
21
22
23
24
|
<CountTo
suffix="$"
:color="'rgb(0,238,0)'"
:startVal="1"
:endVal="400000"
:duration="7000"
/>
|
vben
authored
|
25
26
|
</CardGrid>
<CardGrid class="count-to-demo-card">
|
|
27
28
29
30
31
32
33
|
<CountTo
separator="-"
:color="'rgba(138,43,226,.6)'"
:startVal="10000"
:endVal="500000"
:duration="8000"
/>
|
vben
authored
|
34
35
|
</CardGrid>
</Card>
|
vben
authored
|
36
|
</PageWrapper>
|
vben
authored
|
37
38
39
40
41
|
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { Card } from 'ant-design-vue';
import { CountTo } from '/@/components/CountTo/index';
|
vben
authored
|
42
43
|
import { PageWrapper } from '/@/components/Page';
|
vben
authored
|
44
45
46
47
48
|
export default defineComponent({
components: {
Card,
CardGrid: Card.Grid,
CountTo,
|
vben
authored
|
49
|
PageWrapper,
|
vben
authored
|
50
51
52
53
54
55
56
57
58
59
60
61
|
},
});
</script>
<style lang="less" scoped>
.count-to-demo {
&-card {
width: 50%;
font-size: 30px;
text-align: center;
}
}
</style>
|