Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

434
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda