From fac02ecf564607d575979171e04be8a519c26306 Mon Sep 17 00:00:00 2001 From: Formula Date: Sat, 21 Oct 2023 22:23:02 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=82=B9=E5=87=BB?= =?UTF-8?q?icon=E5=90=8E=E8=B6=85=E8=BF=87min-max=E8=8C=83=E5=9B=B4?= =?UTF-8?q?=E9=97=AE=E9=A2=98(#2606)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/__VUE/inputnumber/index.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/packages/__VUE/inputnumber/index.vue b/src/packages/__VUE/inputnumber/index.vue index 818de01545..7ddaa9bcbb 100644 --- a/src/packages/__VUE/inputnumber/index.vue +++ b/src/packages/__VUE/inputnumber/index.vue @@ -107,8 +107,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'); @@ -116,8 +116,8 @@ export default create({ }; const add = (event: Event) => { emit('add', event); - if (addAllow()) { - let output_value = Number(props.modelValue) + Number(props.step); + let output_value = Number(props.modelValue) + Number(props.step); + if (addAllow() && output_value <= Number(props.max)) { emitChange(output_value, event); } else { emit('overlimit', event, 'add'); From 2dfe1d7d77c9741775dbe0903003071ce2197c90 Mon Sep 17 00:00:00 2001 From: Formula Date: Sun, 22 Oct 2023 08:58:52 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dtaro=E7=BB=84?= =?UTF-8?q?=E4=BB=B6input-number=EF=BC=8C=E7=82=B9=E5=87=BBicon=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E8=B6=85=E8=BF=87min-max=E8=8C=83=E5=9B=B4=E9=97=AE?= =?UTF-8?q?=E9=A2=98(#2606)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/__VUE/inputnumber/index.taro.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/packages/__VUE/inputnumber/index.taro.vue b/src/packages/__VUE/inputnumber/index.taro.vue index 64a8153e8a..4761d1852c 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,8 +121,8 @@ export default create({ }; const add = (event: Event) => { emit('add', event); - if (addAllow()) { - let output_value = Number(props.modelValue) + Number(props.step); + let output_value = Number(props.modelValue) + Number(props.step); + if (addAllow() && output_value <= Number(props.max)) { emitChange(output_value, event); } else { emit('overlimit', event, 'add'); From 20a75f006bf4458240419effee6cb8b340c545cb Mon Sep 17 00:00:00 2001 From: Formula Date: Sun, 22 Oct 2023 09:14:22 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E5=9C=A8=E7=82=B9=E5=87=BBicon?= =?UTF-8?q?=E8=B6=85=E5=87=BA=E8=BE=B9=E7=95=8C=E5=80=BC=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=E4=B8=BA=E8=BE=B9=E7=95=8C=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/__VUE/inputnumber/index.taro.vue | 4 +++- src/packages/__VUE/inputnumber/index.vue | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/packages/__VUE/inputnumber/index.taro.vue b/src/packages/__VUE/inputnumber/index.taro.vue index 4761d1852c..271ce667cc 100644 --- a/src/packages/__VUE/inputnumber/index.taro.vue +++ b/src/packages/__VUE/inputnumber/index.taro.vue @@ -102,7 +102,7 @@ export default create({ const emitChange = (value: string | number, event: Event) => { let output_value: number | string = fixedDecimalPlaces(value); emit('update:modelValue', output_value, event); - emit('change', output_value, event); + if (Number(props.modelValue) !== Number(output_value)) emit('change', output_value, event); }; const addAllow = (value = Number(props.modelValue)): boolean => { return value < Number(props.max) && !props.disabled; @@ -116,6 +116,7 @@ export default create({ if (reduceAllow() && output_value >= Number(props.min)) { emitChange(output_value, event); } else { + emitChange(Number(props.min), event); emit('overlimit', event, 'reduce'); } }; @@ -125,6 +126,7 @@ export default create({ if (addAllow() && output_value <= Number(props.max)) { emitChange(output_value, event); } else { + emitChange(Number(props.max), event); emit('overlimit', event, 'add'); } }; diff --git a/src/packages/__VUE/inputnumber/index.vue b/src/packages/__VUE/inputnumber/index.vue index 7ddaa9bcbb..f058c336fa 100644 --- a/src/packages/__VUE/inputnumber/index.vue +++ b/src/packages/__VUE/inputnumber/index.vue @@ -97,7 +97,7 @@ export default create({ const emitChange = (value: string | number, event: Event) => { let output_value: number | string = fixedDecimalPlaces(value); emit('update:modelValue', output_value, event); - emit('change', output_value, event); + if (Number(props.modelValue) !== Number(output_value)) emit('change', output_value, event); }; const addAllow = (value = Number(props.modelValue)): boolean => { return value < Number(props.max) && !props.disabled; @@ -111,6 +111,7 @@ export default create({ if (reduceAllow() && output_value >= Number(props.min)) { emitChange(output_value, event); } else { + emitChange(Number(props.min), event); emit('overlimit', event, 'reduce'); } }; @@ -120,6 +121,7 @@ export default create({ if (addAllow() && output_value <= Number(props.max)) { emitChange(output_value, event); } else { + emitChange(Number(props.max), event); emit('overlimit', event, 'add'); } };