From db05975f040a04c6351c627f70aab75854f5f544 Mon Sep 17 00:00:00 2001 From: Formula <84565335+Formulaaa@users.noreply.github.com> Date: Sun, 22 Oct 2023 08:09:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dtaro=E4=B8=ADinput-num?= =?UTF-8?q?ber=E7=BB=84=E4=BB=B6=E7=82=B9=E5=87=BBicon=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E8=B6=85=E5=87=BAmin-max=E8=8C=83=E5=9B=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/__VUE/inputnumber/index.taro.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/packages/__VUE/inputnumber/index.taro.vue b/src/packages/__VUE/inputnumber/index.taro.vue index 64a8153e8a3..f0aa1011e8c 100644 --- a/src/packages/__VUE/inputnumber/index.taro.vue +++ b/src/packages/__VUE/inputnumber/index.taro.vue @@ -112,8 +112,8 @@ export default create({ }; const reduce = (event: Event) => { emit('reduce', event); - if (reduceAllow()) { - let output_value = Number(props.modelValue) - Number(props.step); + let output_value = Number(props.modelValue) - Number(props.step); + if (reduceAllow() && output_value >= Number(props.min)) { emitChange(output_value, event); } else { emit('overlimit', event, 'reduce'); @@ -121,9 +121,9 @@ export default create({ }; const add = (event: Event) => { emit('add', event); - if (addAllow()) { - let output_value = Number(props.modelValue) + Number(props.step); - emitChange(output_value, event); + let output_value = Number(props.modelValue) + Number(props.step); + if (addAllow() && output_value <= Number(props.max)) { + emitChange(output_value, event);X } else { emit('overlimit', event, 'add'); }