Statistic 统计组件

显示统计数据。

基础用法

用于突出某个或某组数字时,如统计数值、金额、排名等,数值和标题前后都可以加icon、单位等元素。可以使用 vueuse 实现数值的变化动效

Daily active users
268,500
Ratio of men to women
138
/100
Total Transactions
172,000
Feedback number
562

倒计时

倒计时组件,支持添加其他组件来控制。

Start to grab
00:00:00
Remaining VIP time
00:00:00
Still to go until next month
00 days 00:00:00
2026-11-01

TIP

在格式化过程中,建议在天数范围内

统计卡片

卡片式用法展示,可以自由组合

Daily active users
98,500
than yesterday24%
Monthly Active Users
693,700
month on month12%
New transactions today
72,000
than yesterday16%

Statistic API

Statistic Attributes

属性名说明类型默认值
value数值number / string0
precision小数精度,不足补零、超出截断number0
group-separator千分位分隔符string,
decimal-separator小数点分隔符string.
formatter自定义格式化函数,传入后忽略上述格式化配置Function—
title标题string / ReactNode—
prefix数值前缀string / ReactNode—
suffix数值后缀string / ReactNode—
value-style数值样式object—

Statistic Slots

插槽名说明React 写法
title标题内容title
prefix前缀内容prefix
suffix后缀内容suffix

Countdown API

Countdown Attributes

属性名说明类型默认值
value目标时间number / Dayjs0
format倒计时显示格式stringHH:mm:ss
prefix数值前缀string / ReactNode—
suffix数值后缀string / ReactNode—
title倒计时标题string / ReactNode—
value-style数值样式object—

Countdown Events

事件名说明类型
onChange时间差变化时触发,每帧一次Function
onFinish倒计时结束时触发Function

Countdown Slots

插槽名说明React 写法
prefix倒计时数值前缀prefix
suffix倒计时数值后缀suffix
title倒计时标题title

Countdown Exposes

方法名说明类型
displayValue当前展示文本object

Countdown 格式占位符

占位符含义
Y年(按 365 天折算)
M月(按 30 天折算)
D天
H小时
m分钟
s秒
S毫秒

连续书写会自动补零(如 HH),方括号内的文本原样输出(如 [days])。