Skip to content

Statistic 统计数值

展示统计数值。

基础用法

用户总数
12345
订单总数
8846
访问量
923456
vue
<template>
  <x-statistic title="用户总数" :value="12345" />
</template>

<script setup>
import { Statistic } from '@xto/business'
</script>

带前缀和后缀

收入
¥98765
增长率
13%
完成率
89%
vue
<template>
  <x-statistic title="收入" :value="98765" prefix="¥" suffix="元" />
</template>

带趋势

增长率
13%
2.3%
下降率
6%
1.2%
vue
<template>
  <x-statistic
    title="增长率"
    :value="12.5"
    suffix="%"
    trend="up"
    trendValue="2.3%"
  />
</template>

API

Props

属性说明类型默认值
title标题string
value数值number | string0
prefix前缀string
suffix后缀string
precision小数精度number0
trend趋势方向'up' | 'down'
trendValue趋势值string
valueColor数值颜色string

基于 MIT 许可发布