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

154
Vistas
Vue v-for and variable logic unclear

trying to code a chatPage from a tutorial, the tutorial was releases in vue 2.0 and now i wanna use the new vue 3.0 version.

I have a messageContainer which will display the chatMessages. it has the messages as an array and it should loop over them and display each one as a messageItem. Yet, the syntax with the v-for loop says that the new varible, message, is written but never read, when just one line below this is what i am trying to do. what am i missing here?

<div v-for="(message, index) in messages" :key="index" ></div>
<MessageItem :message="message" />

the first mention of message is said to be written and not read. am i not reading it below that?

also im definitely having the values:
[{"id":21,"chat_room_id":1,"user_id":1,"message":"asdas","created_at":"2022-08-27T12:38:27.000000Z","updated_at":"2022-08-27T12:38:27.000000Z","user":{

with kind regards.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The MessageItem should be inside the <div> tag:

<div v-for="(message, index) in messages" :key="index">
    <MessageItem :message="message" />
</div>
about 4 years ago · Juan Pablo Isaza 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