diff --git a/src/components/cards/StorageCard.vue b/src/components/cards/StorageCard.vue index da06916c..dae73446 100644 --- a/src/components/cards/StorageCard.vue +++ b/src/components/cards/StorageCard.vue @@ -31,6 +31,11 @@ const total = ref(0) // 存储可用空间 const available = ref(0) +// 储存已用空间 +const used = computed(() => { + return total.value - available.value +}) + // 阿里云盘认证对话框 const aliyunAuthDialog = ref(false) // 115网盘认证对话框 @@ -85,7 +90,7 @@ const progressColor = computed(() => { // 计算存储使用率 const usage = computed(() => { - return Math.round((available.value / (total.value || 1)) * 1000) / 10 + return Math.round(((used.value) / (total.value || 1)) * 1000) / 10 }) // 查询存储信息 @@ -116,7 +121,7 @@ onMounted(() => {
{{ storage.name }}
-
{{ formatBytes(available, 1) }} / {{ formatBytes(total, 1) }}
+
{{ formatBytes(used, 1) }} / {{ formatBytes(total, 1) }}
未配置