Blame view

src/views/demo/comp/count-to/index.vue 1.17 KB
1
<template>
2
  <PageWrapper title="数字动画示例">
3
4
5
6
7
8
9
10
11
12
13
14
15
16
    <Card>
      <CardGrid class="count-to-demo-card">
        <CountTo prefix="$" :startVal="1" :endVal="200000" :duration="8000" />
      </CardGrid>
      <CardGrid class="count-to-demo-card">
        <CountTo suffix="$" :startVal="1" :endVal="300000" :decimals="2" :duration="6000" />
      </CardGrid>
      <CardGrid class="count-to-demo-card">
        <CountTo suffix="$" :startVal="1" :endVal="400000" :duration="7000" />
      </CardGrid>
      <CardGrid class="count-to-demo-card">
        <CountTo separator="-" :startVal="10000" :endVal="500000" :duration="8000" />
      </CardGrid>
    </Card>
17
  </PageWrapper>
18
19
20
21
22
</template>
<script lang="ts">
  import { defineComponent } from 'vue';
  import { Card } from 'ant-design-vue';
  import { CountTo } from '/@/components/CountTo/index';
23
24
  import { PageWrapper } from '/@/components/Page';
25
26
27
28
29
  export default defineComponent({
    components: {
      Card,
      CardGrid: Card.Grid,
      CountTo,
30
      PageWrapper,
31
32
33
34
35
36
37
38
39
40
41
42
    },
  });
</script>
<style lang="less" scoped>
  .count-to-demo {
    &-card {
      width: 50%;
      font-size: 30px;
      text-align: center;
    }
  }
</style>