From bbf8666efe751473fc57470bae4059b158c31b65 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Wed, 6 Jul 2022 17:19:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(input)=EF=BC=9A=E4=BF=AE=E5=A4=8D=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEstep=E6=97=A0=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/view/components/input/index.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/core/view/components/input/index.vue b/src/core/view/components/input/index.vue index d65db8b00..a8e5baaaa 100644 --- a/src/core/view/components/input/index.vue +++ b/src/core/view/components/input/index.vue @@ -21,7 +21,7 @@ :disabled="disabled" :type="inputType" :maxlength="maxlength" - :step="step" + :step="_step" :enterkeyhint="confirmType" :pattern="type === 'number' ? '[0-9]*' : null" class="uni-input-input" @@ -44,7 +44,7 @@ :readonly="disabled" :type="inputType" :maxlength="maxlength" - :step="step" + :step="_step" class="uni-input-input" @focus="($event) => $event.target.blur()" > @@ -102,6 +102,10 @@ export default { textContentType: { type: String, default: '' + }, + step: { + type: String, + default: '0.000000000000000001' } }, data () { @@ -130,9 +134,9 @@ export default { } return this.password ? 'password' : type }, - step () { + _step () { // 处理部分设备中无法输入小数点的问题 - return ~NUMBER_TYPES.indexOf(this.type) ? '0.000000000000000001' : '' + return ~NUMBER_TYPES.indexOf(this.type) ? this.step : '' }, autocomplete () { const camelizeIndex = AUTOCOMPLETES.indexOf(this.textContentType) -- GitLab