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

229
Vistas
error while trying to send an array of numbers

I have to fix a bug that some data is missing when sending the form. I have this typescript interface

  _id: string
  name: string
  coords?: number[] 
  createdAt?: Date
  updatedAt?: Date
  deletedAt?: Date
}

these are my props:

props: {
    data: {
      type: Object as PropType<Location>,
      default: () => ({
        _id: null,
        name: '',
        createdAt: '',
        updatedAt: ''
      })
    }
  },

and this is how I´m creating the v-model:

const location = reactive({ ...props.data } as Location)

    const rules = {
      name: { required },
      coords: { required }
    }
    const v$ = useVuelidate(rules, location)

And I´m having an error like this

 Types of property 'name' are incompatible.
      Type 'string' is not assignable to type 'Ref<any>'.
    76 |       coords: { required }
    77 |     }
  > 78 |     const v$ = useVuelidate(rules, location)
about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

As cords are required on rules, either set a default value for it or remove optional properties in the Location interface

about 4 years ago · Santiago Gelvez 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