From c470d0ef454e7524d70b7ac525b326e2552433d1 Mon Sep 17 00:00:00 2001 From: Eiinu Date: Thu, 21 Dec 2023 17:26:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(input-number):=20=E4=BF=AE=E5=A4=8D=20disab?= =?UTF-8?q?led=20=E4=B8=8B=E6=9C=AA=E7=A6=81=E7=94=A8=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#2783)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #2782 --- src/packages/__VUE/inputnumber/index.taro.vue | 2 ++ src/packages/__VUE/inputnumber/index.vue | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packages/__VUE/inputnumber/index.taro.vue b/src/packages/__VUE/inputnumber/index.taro.vue index bb60d98753..c1b7925cd2 100644 --- a/src/packages/__VUE/inputnumber/index.taro.vue +++ b/src/packages/__VUE/inputnumber/index.taro.vue @@ -111,6 +111,7 @@ export default create({ return value > Number(props.min) && !props.disabled; }; const reduce = (event: Event) => { + if (props.disabled) return; emit('reduce', event); let output_value = Number(props.modelValue) - Number(props.step); if (reduceAllow() && output_value >= Number(props.min)) { @@ -121,6 +122,7 @@ export default create({ } }; const add = (event: Event) => { + if (props.disabled) return; emit('add', event); let output_value = Number(props.modelValue) + Number(props.step); if (addAllow() && output_value <= Number(props.max)) { diff --git a/src/packages/__VUE/inputnumber/index.vue b/src/packages/__VUE/inputnumber/index.vue index f19088854c..bab765659d 100644 --- a/src/packages/__VUE/inputnumber/index.vue +++ b/src/packages/__VUE/inputnumber/index.vue @@ -92,7 +92,6 @@ export default create({ }; const change = (event: Event) => { const input = event.target as HTMLInputElement; - emit('update:modelValue', input.value, event); }; const emitChange = (value: string | number, event: Event) => { @@ -155,7 +154,6 @@ export default create({ } return value; }; - watch( () => [props.max, props.min], () => {