mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
docs(components): [statistic] add transition example (#14959)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user