From ee9eb0e7a6a95dd068366be1826266d6ba511661 Mon Sep 17 00:00:00 2001 From: clz Date: Tue, 6 Sep 2022 18:53:52 +0800 Subject: [PATCH] =?UTF-8?q?fix.=F0=9F=9B=A0=EF=B8=8F:=20=E6=9B=B4=E6=94=B9?= =?UTF-8?q?bill=E6=A0=A1=E9=AA=8C=E8=A7=84=E5=88=99=20&=20=E6=9B=B4?= =?UTF-8?q?=E6=94=B9table=20size?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Record/Record.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/Record/Record.tsx b/src/pages/Record/Record.tsx index 40844e1..78516ed 100644 --- a/src/pages/Record/Record.tsx +++ b/src/pages/Record/Record.tsx @@ -100,7 +100,7 @@ function Record() { bill.money = Number(money) bill.options = options const checkBill = () => { - return bill.cls !== '' && bill.label !== '' && bill.money !== 0 + return bill.cls !== '' && bill.label !== '' && bill.money > 0 } const reset = () => { setCls("") @@ -195,7 +195,7 @@ function Record() { placeholder="money" prefix="¥" value={money} - onChange={setMoney} + onChange={value => Number(value) < 0 ? setMoney('') : setMoney(value)} onKeyDown={e => e.key === "Enter" && submit()} />