docs(components): [statistic] add transition example (#14959)

This commit is contained in:
wzc520pyfm
2023-12-26 19:25:00 +08:00
committed by GitHub
parent 972f236a12
commit 61ac2fe752
2 changed files with 10 additions and 2 deletions

View File

@@ -9,7 +9,7 @@ Display statistics.
## Basic usage
:::demo To highlight a number or a group of numbers, such as statistical value, amount, and ranking, you can add elements such as icon and unit before and after the number and title.
:::demo To highlight a number or a group of numbers, such as statistical value, amount, and ranking, you can add elements such as icon and unit before and after the number and title. And use [vueuse](https://vueuse.org/core/useTransition/) to add animated transitions to value.
statistic/basic

View File

@@ -17,7 +17,7 @@
</el-statistic>
</el-col>
<el-col :span="6">
<el-statistic title="Total Transactions" :value="172000" />
<el-statistic title="Total Transactions" :value="outputValue" />
</el-col>
<el-col :span="6">
<el-statistic title="Feedback number" :value="562">
@@ -32,7 +32,15 @@
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { useTransition } from '@vueuse/core'
import { ChatLineRound, Male } from '@element-plus/icons-vue'
const source = ref(0)
const outputValue = useTransition(source, {
duration: 1500,
})
source.value = 172000
</script>
<style scoped>