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

227
Views
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 answers
Answer question

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 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!