TBytes / 字节格式化
Bytes formats numeric byte values into human-readable strings (e.g., 1.5 MB, 2.3 GiB). Supports binary/decimal base and IEC standard units. / 字节格式化将数字字节值转为可读字符串(如 1.5 MB),支持二进制/十进制和 IEC 标准单位。
Props / 属性
| Prop | Type / 类型 | Default / 默认值 | Description / 说明 |
|---|---|---|---|
value | number | — | Byte value (required) |
decimals | number | 1 | Decimal places |
base | number | 1024 | Base (1024=binary, 1000=decimal) |
iec | boolean | false | IEC units (KiB/MiB) |
Basic Usage / 基础用法
vue
<script setup lang="ts">
import { TBytes } from '@gulcc/tabler-vue'
</script>
<template>
<TBytes :value="1536" />
<TBytes :value="1536" :base="1000" />
<TBytes :value="1536" iec />
</template>