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

217
Vistas
how can i use variable declared inline in vue js?

I'm working with Vue.js (version 3) and I wanted to do something like this:

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

but Vue returns the error:

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

Since, as I suppose, he's looking for item in data, where I created the Vue app. Is there anyway to solve this issue? Maybe some workaround to obtain the same effect?

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

It's not recommended to use v-if and v-for on the same element due to implicit precedence.

according to the official docs

so you should do :


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

0

You can not access v-for and v-if in the same line, if you do so Priority has been given to your v-if condition , this was the reason you are getting that error

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