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

178
Vistas
How to dynamically validate using Yup

Basically I got an input form, I want to show error if min length is not met.

I have a multiselect component that has input inside it, and on option select the input max length should change. I got this function that changes the refs value.

<Multiselect @select="makeMaxLength()" />
  function makeMaxLength() {
      const maxLength = passwordType().length
      maxPasswordLength.value = maxLength
      console.log(maxPasswordLength.value) // works fine and always shows new value
    }

even when the ref changes I keep getting this error passwordAnswer must be at most 0 characters

   const schema = yup.object().shape({
    passwordAnswer: yup.string().max(maxPasswordLength.value),
    });

I've tried this as well but here I get passwordAnswer must be at most [Function anonymous] characters

 const schema = yup.object().shape({
    passwordAnswer: yup.string().max(() => maxPasswordLength.value),
    });
about 4 years ago · Juan Pablo Isaza
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