From 1fd9c7bb3c810bc39840541f6c342280496e7f37 Mon Sep 17 00:00:00 2001 From: "chen.zhang" <422734124@qq.com> Date: Mon, 15 Jul 2024 09:52:51 +0800 Subject: [PATCH] =?UTF-8?q?bugfix(input):=20=E4=BF=AE=E5=A4=8D=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E8=BE=93=E5=85=A5=E6=A1=86=E5=9C=A8=E7=A9=BA=E5=80=BC?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E7=82=B9=E5=87=BB=E4=B8=8A=E4=B8=8B?= =?UTF-8?q?=E6=8C=89=E9=94=AE=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=9C=80=E5=A4=A7?= =?UTF-8?q?/=E5=B0=8F=E5=80=BC=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/input/input.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/input/input.vue b/src/components/input/input.vue index b26a040..379c320 100644 --- a/src/components/input/input.vue +++ b/src/components/input/input.vue @@ -594,15 +594,15 @@ export default { } }, handleNumberDelete (event) { - let flag = false + let isRawValEmpty = false if (this.curValue === '') { - flag = true + isRawValEmpty = true this.curValue = this.initialControlValue === undefined ? this.max : Math.min(this.initialControlValue, this.max) } const curNumberValue = Number(this.curValue) if (curNumberValue - 1 >= this.min) { const curLenAfterDot = (String(curNumberValue) || '').split('.')[1] || '' - let newVal = flag ? curNumberValue : curNumberValue - 1 + let newVal = isRawValEmpty ? curNumberValue : curNumberValue - 1 if (typeof this.precision !== 'undefined') { newVal = this.handleToFixed(newVal, Math.min(16, Math.max(curLenAfterDot.length, this.precision))) } @@ -613,15 +613,15 @@ export default { } }, handleNumberAdd (event) { - let flag = false + let isRawValEmpty = false if (this.curValue === '') { - flag = true + isRawValEmpty = true this.curValue = this.initialControlValue === undefined ? this.min : Math.max(this.initialControlValue, this.min) } const curNumberValue = Number(this.curValue) if (curNumberValue <= this.max - 1) { const curLenAfterDot = (String(curNumberValue) || '').split('.')[1] || '' - let newVal = flag ? curNumberValue : curNumberValue + 1 + let newVal = isRawValEmpty ? curNumberValue : curNumberValue + 1 if (typeof this.precision !== 'undefined') { newVal = this.handleToFixed(newVal, Math.min(16, Math.max(curLenAfterDot.length, this.precision))) }