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()} />