@@ -6,9 +6,34 @@ const input = ref<{ size: string; unit: string }>({ size: '0', unit: 'KB' });
6
6
const output = ref <{ unit: string ; precision: number ; appendUnit: boolean }>({ unit: ' MB' , precision: 3 , appendUnit: false });
7
7
8
8
const allUnits = [
9
- ' iB' , ' KiB' , ' MiB' , ' GiB' , ' TiB' , ' PiB' , ' EiB' , ' ZiB' , ' YiB' ,
10
- ' B' , ' KB' , ' MB' , ' GB' , ' TB' , ' PB' , ' EB' , ' ZB' , ' YB' ,
11
- ' b' , ' Kb' , ' Mb' , ' Gb' , ' Tb' , ' Pb' , ' Eb' , ' Zb' , ' Yb' ];
9
+ { value: ' B' , label: ' Bytes (B)' },
10
+ { value: ' b' , label: ' Bits (bit)' },
11
+ { value: ' iB' , label: ' Bibytes (iB)' },
12
+ { value: ' KB' , label: ' Kilobytes (KB)' },
13
+ { value: ' Kb' , label: ' Kilobits (Kbit)' },
14
+ { value: ' KiB' , label: ' Kibibytes (KiB)' },
15
+ { value: ' MB' , label: ' Megabytes (MB)' },
16
+ { value: ' Mb' , label: ' Megabits (Mbit)' },
17
+ { value: ' MiB' , label: ' Mebibytes (MiB)' },
18
+ { value: ' GB' , label: ' Gigabytes (GB)' },
19
+ { value: ' Gb' , label: ' Gigabits (Gbit)' },
20
+ { value: ' GiB' , label: ' Gibibytes (GiB)' },
21
+ { value: ' TB' , label: ' Terabytes (TB)' },
22
+ { value: ' Tb' , label: ' Terabits (Tbit)' },
23
+ { value: ' TiB' , label: ' Tebibytes (TiB)' },
24
+ { value: ' PB' , label: ' Petabytes (PB)' },
25
+ { value: ' Pb' , label: ' Petabits (Pbit)' },
26
+ { value: ' PiB' , label: ' Pebibytes (PiB)' },
27
+ { value: ' EB' , label: ' Exabytes (EB)' },
28
+ { value: ' Eb' , label: ' Exabits (Ebit)' },
29
+ { value: ' EiB' , label: ' Exbibytes (EiB)' },
30
+ { value: ' ZB' , label: ' Zettabytes (ZB)' },
31
+ { value: ' Zb' , label: ' Zettabits (Zbit)' },
32
+ { value: ' ZiB' , label: ' Zebibytes (ZiB)' },
33
+ { value: ' YB' , label: ' Yottabytes (YB)' },
34
+ { value: ' Yb' , label: ' Yottabits (Ybit)' },
35
+ { value: ' YiB' , label: ' Yobibytes (YiB)' },
36
+ ];
12
37
13
38
const convertedValue = computed (() => {
14
39
try {
@@ -51,7 +76,7 @@ const convertedValue = computed(() => {
51
76
/>
52
77
53
78
<n-form-item label =" Precision:" label-placement =" left" >
54
- <n-input-number v-model:value =" output.precision" placeholder =" Precision..." :max =" 10" :min =" 0" />
79
+ <n-input-number v-model:value =" output.precision" style = " width : 100 px " placeholder =" Precision..." :max =" 10" :min =" 0" />
55
80
</n-form-item >
56
81
57
82
<n-checkbox v-model:checked =" output.appendUnit" >
0 commit comments