Back to Element Plus

Statistic

docs/en-US/component/statistic.md

2.13.74.4 KB
Original Source

Statistic

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. And use vueuse to add animated transitions to value.

statistic/basic

:::

Countdown

:::demo Countdown component, support to add other components control countdown.

statistic/countdown ::: :::tip

In formatting it is suggested to be in the range of days

:::

Card usage

:::demo Card usage display, can be freely combined

statistic/card

:::

Statistic API

Statistic Attributes

AttributeDescriptionTypeDefault
valueNumerical content^[number]0
decimal-separatorSetting the decimal point^[string].
formatterCustom numerical presentation^[Function](value: number) => string | number
group-separatorSets the thousandth identifier^[string],
precisionnumerical precision^[number]0
prefixSets the prefix of a number^[string]
suffixSets the suffix of a number^[string]
titleNumeric titles^[string]
value-styleStyles numeric values^[string] / ^[object]CSSProperties | CSSProperties[] | string[]

Statistic Slots

NameDescription
prefixNumeric prefix
suffixSuffixes for numeric values
titleNumeric titles

Statistic Exposes

NameDescriptionType
displayValuecurrent display value^[object]Ref<string | number>

Countdown API

Countdown Attributes

AttributeDescriptionTypeDefault
valuetarget time^[number] / ^[Dayjs]
formatFormatting the countdown display^[string]HH:mm:ss
prefixSets the prefix of a countdown^[string]
suffixSets the suffix of a countdown^[string]
titlecountdown titles^[string]
value-styleStyles countdown values^[string] / ^[object]CSSProperties | CSSProperties[] | string[]

Countdown Events

NameDescriptionType
changeTime difference change event^[Function](value: number) => void
finishcountdown end event^[Function]() => void

Countdown Slots

NameDescription
prefixcountdown value prefix
suffixcountdown value suffix
titlecountdown title

Countdown Exposes

NameDescriptionType
displayValuecurrent display value^[object]Ref<string>