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

223
Views
¿Cómo puedo usar la variable declarada en línea en vue js?

Estoy trabajando con Vue.js (versión 3) y quería hacer algo como esto:

 <div v-for="item in list" v-if="item.someAttribute === someOtherVariable">

pero Vue devuelve el error:

 Property "item" was accessed during render but is not defined on instance

Dado que, como supongo, está buscando un elemento en datos , donde creé la aplicación Vue. ¿Hay alguna manera de resolver este problema? ¿Quizás alguna solución para obtener el mismo efecto?

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

No se recomienda usar v-if y v-for en el mismo elemento debido a la precedencia implícita.

según los documentos oficiales

por lo que debe hacer:

 <template v-for="item in list"> <div v-if="item"> .... </div> </template>
about 4 years ago · Santiago Trujillo Report

0

No puede acceder a v-for y v-if en la misma línea, si lo hace, se le ha dado prioridad a su condición v-if , esta fue la razón por la que está recibiendo ese error

 <div v-for="item in list"> <span v-if="item.someAttribute === someOtherVariable">...</span> </div>
about 4 years ago · Santiago Trujillo 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!