Skip to content

数值 Statistic

基础用法

100.91
vue
<template>
  <bp-button size="small" type="plain" @click="random" style="margin-bottom: 20px">切换</bp-button>

  <bp-statistic v-model="value" animation :precision="2" :font-size="['26px', '26px']"> </bp-statistic>
</template>

<script setup lang="ts">
import { ref } from "vue";

const value = ref(100.91);

const random = () => {
  value.value = (Math.floor(Math.random() * 9999999) + 1) / 100;
};
</script>

Statistic 属性

v-model绑定值
Number
--
value数值
Number
--
placeholder占位文本
String
---
separator千分位分隔符
String
,-
show-separator是否显示千分位
Boolean
--
color文字颜色
String
--
unit单位
String
--
precision小数精度
Number
--
font-size字体大小
StringArray
26px-
animation是否开启动画
Boolean
--
duration动画时长
Number
1000-
value-from动画起始值
Number
--

Statistic 插槽

prefix前缀内容--