问题原因:
vux版本2.9之后都会有问题
解决方法:
1.回退版本
2.修改源码
ps: 修改源码 没次npm install时都需要修改
项目中node_modules---->src---->components---->x-input---->index.vue
找到其中的onBlur ($event) ,添加时间
修改后为:
onBlur ($event) {
this.setTouched()
this.validate()
setTimeout(() => {
this.isFocus = false
}, 200)
this.$emit('on-blur', this.currentValue, $event)
},
还有在onKeyUp(e)中添加 this.isFocus = true
修改后为:
onKeyUp (e) {
if (e.key === 'Enter') {
e.target.blur()
this.isFocus = true
this.$emit('on-enter', this.currentValue, e)
}
},