数值 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 | 前缀内容 | - | - |