fix(BillReminders): 修复金额显示的空值判断
- 修改金额判断条件,兼容 null 和 undefined 值 - 优化渲染逻辑,避免金额为 null 时错误渲染 - 保持界面金额显示样式一致
This commit is contained in:
@@ -204,7 +204,7 @@ const BillReminders: React.FC<BillRemindersProps> = ({ reminders, onAdd, onUpdat
|
||||
{r.isCompleted && <svg className="w-3 h-3 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={3} d="M5 13l4 4L19 7" /></svg>}
|
||||
</button>
|
||||
<span className={`font-bold text-sm truncate ${r.isCompleted ? 'line-through text-gray-400' : 'text-gray-800'}`}>{r.title}</span>
|
||||
{r.amount !== undefined && (
|
||||
{r.amount != null && (
|
||||
<span className="font-mono text-gray-500 font-bold text-[10px] bg-gray-50 px-1 rounded">¥{r.amount}</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user