Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

425
Views
Vee-validade vue3 setErrors can't define filed

I am using Vue 3 and vee-validate and yup schema to validate a form before sending the post request and it's working ok, but my problem is when the response comes from the server, for example, a duplicated email, I am struggling to validate the errors. If i do this:

form.value.setErrors({
     email: 'my error message'
 });

it works ok!

but i want to loop in my array of errors to see the fields(param) and the error messages(msg) but i can’t define the param as i do her:

for (const error of errors.response.data.errors) {
  let param = error.param;
  let msg = error.msg;
  form.value.setErrors({
     param: msg
  });
}

What i expect is loop in my “errors.response.data.errors” and setErrors () with-param and msg variables

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Computed property names feature was introduced in ECMAScript 2015 (ES6) that allows you to dynamically compute the names of the object properties in JavaScript object literal notation.

i had to use [param]:msg

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!