Skip to content

Commit 1452f6c

Browse files
authored
fix: 修复台式电脑下当前电量显示NaN问题 (#240)
笔记本才会显示电池电量,台式时没有
1 parent 659bfdd commit 1452f6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/views/dashboard/welcome/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
? calcDischargingTime.value
5252
: '未知',
5353
电池状态: batteryStatus.value,
54-
当前电量: `${battery.level}%`,
54+
当前电量: battery.level ? `${battery.level}%` : '未知',
5555
});
5656
});
5757

0 commit comments

Comments
 (0)