提交 77445489 编写于 作者: Q qiang

fix: input value null

上级 a0c1d1d7
......@@ -97,7 +97,7 @@ export default {
},
data () {
return {
inputValue: this.value + '',
inputValue: this._getValueString(this.value),
composing: false,
wrapperHeight: 0,
cachedValue: ''
......@@ -133,7 +133,7 @@ export default {
value && this._focusInput()
},
value (value) {
this.inputValue = value + ''
this.inputValue = this._getValueString(value)
},
inputValue (value) {
this.$emit('update:value', value)
......@@ -255,6 +255,9 @@ export default {
value: this.inputValue,
key: this.name
} : {}
},
_getValueString (value) {
return value === null ? '' : String(value)
}
}
}
......@@ -295,7 +298,7 @@ uni-input[hidden] {
}
.uni-input-placeholder,
.uni-input-input{
.uni-input-input {
width: 100%;
}
......
......@@ -119,7 +119,7 @@ export default {
},
data () {
return {
valueSync: String(this.value),
valueSync: this._getValueString(this.value),
valueComposition: '',
composition: false,
focusSync: this.focus,
......@@ -152,7 +152,7 @@ export default {
},
watch: {
value (val) {
this.valueSync = String(val)
this.valueSync = this._getValueString(val)
},
valueSync (val) {
if (val !== this._oldValue) {
......@@ -296,6 +296,9 @@ export default {
},
_resetFormData () {
this.valueSync = ''
},
_getValueString (value) {
return value === null ? '' : String(value)
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册