vux x-input 清除按钮不起作用,解决办法:

找到node_modues—vux—src–components—x-input --index.vue 组件,修改以下三处

   focus () {
      // 优化添加
      setTimeout(() => {
      this.$refs.input.focus()
      }, 0) 
    },
 
 onBlur ($event) {
      this.setTouched()
      this.validate()
      // 优化添加
      setTimeout(() => {
        this.isFocus = false
      }, 0)
      this.$emit('on-blur', this.currentValue, $event)
    },
  onKeyUp (e) {
      if (e.key === 'Enter') {
        e.target.blur()
        this.isFocus = true  //优化添加
        this.$emit('on-enter', this.currentValue, e)
      }

 

posted on 2020-04-14 09:40  二豆  阅读(1026)  评论(0编辑  收藏  举报