提交 bbf8666e 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

fix(input):修复设置step无效问题

上级 0f1c9430
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
:disabled="disabled" :disabled="disabled"
:type="inputType" :type="inputType"
:maxlength="maxlength" :maxlength="maxlength"
:step="step" :step="_step"
:enterkeyhint="confirmType" :enterkeyhint="confirmType"
:pattern="type === 'number' ? '[0-9]*' : null" :pattern="type === 'number' ? '[0-9]*' : null"
class="uni-input-input" class="uni-input-input"
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
:readonly="disabled" :readonly="disabled"
:type="inputType" :type="inputType"
:maxlength="maxlength" :maxlength="maxlength"
:step="step" :step="_step"
class="uni-input-input" class="uni-input-input"
@focus="($event) => $event.target.blur()" @focus="($event) => $event.target.blur()"
> >
...@@ -102,6 +102,10 @@ export default { ...@@ -102,6 +102,10 @@ export default {
textContentType: { textContentType: {
type: String, type: String,
default: '' default: ''
},
step: {
type: String,
default: '0.000000000000000001'
} }
}, },
data () { data () {
...@@ -130,9 +134,9 @@ export default { ...@@ -130,9 +134,9 @@ export default {
} }
return this.password ? 'password' : type return this.password ? 'password' : type
}, },
step () { _step () {
// 处理部分设备中无法输入小数点的问题 // 处理部分设备中无法输入小数点的问题
return ~NUMBER_TYPES.indexOf(this.type) ? '0.000000000000000001' : '' return ~NUMBER_TYPES.indexOf(this.type) ? this.step : ''
}, },
autocomplete () { autocomplete () {
const camelizeIndex = AUTOCOMPLETES.indexOf(this.textContentType) const camelizeIndex = AUTOCOMPLETES.indexOf(this.textContentType)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册