Validate, the error value is written to the object with a one-click delay

17 views Asked by At

I use validate for two inputs. I write in updateRange whether there is an error or not error: $v.range.$anyError. But the problem is this, it is written like this,

I entered the correct value of $v.rank.$any Error = false

entered an invalid value of $v.range.$any Error = false (must be true)

entered the wrong value $v.range again.$anyError = true

Late by one input $nextTick does not helpCan you tell me?

debounceValidateValue: debounce(function (name, value, $v) {
  if (name === 'start') {
    $v.range.start.$touch()
    if (this.range.finish === null) {
      this.updateRange({
        start: value,
        finish: value,
        error: $v.range.$anyError
      })
    } else {
      this.updateRange({
        start: value,
        finish: this.range.finish,
        error: $v.range.$anyError
      })
    }
  } else {
    $v.range.finish.$touch()
    this.updateRange({
      start: this.range.start,
      finish: value,
      error: $v.range.$anyError
    })
  }

}, 500),



I use

this.$nextTick(() => {
  this.jobsFilterByAdmin.salaryRange.error
})
0

There are 0 answers