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

271
Views
El objeto es posiblemente 'indefinido' en Vue con esto. $ refs

Cambié a mecanografiado y de repente algunos de mis códigos tienen errores con:

Object is possibly 'undefined'

La versión mecanografiada es 3.2.1

Aquí está el código:

 this.$refs[`stud-copy-${index}`][0].innerHTML = 'Link Copied'

Intenté agregar una condición if para verificar si no está definido, pero no tuve suerte:

 if (this.$refs[`stud-copy-${index}`] !== undefined) { this.$refs[`stud-copy-${index}`][0].innerHTML = 'Link Copied' }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

puedes probar esto

 (this.$refs[`stud-copy-${index}`] as HTMLElement[])[0].innerHTML = 'Link Copied'
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!