From b8fca7bed2143238aa2a3fe832f4444e9f8b2e81 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com>
Date: Wed, 15 Jul 2026 23:10:21 +0800
Subject: [PATCH] =?UTF-8?q?fix(user):=20=E4=BF=AE=E6=AD=A3=E6=95=B0?=
=?UTF-8?q?=E9=87=8F=E8=A7=92=E6=A0=87=E4=B8=BA=E6=95=B0=E5=AD=97=E6=97=B6?=
=?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 去除对 item.count 存在性的判断,改为直接将 count 转换为数字后判断
- 确保当 count 为字符串数字且大于0时角标正常显示
- 优化数量角标的渲染条件,提高代码健壮性
---
src/pages/user/user.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pages/user/user.tsx b/src/pages/user/user.tsx
index a8020eb..b66ba80 100644
--- a/src/pages/user/user.tsx
+++ b/src/pages/user/user.tsx
@@ -278,7 +278,7 @@ const UserPage: React.FC = () => {
{item.icon}
{item.label}
{/* 数量角标:紧贴图标右上角;为 0 时不渲染 */}
- {item.count && Number(item.count) > 0 && (
+ {Number(item.count) > 0 && (
{Number(item.count) > 99 ? '99+' : item.count}