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

182
Vistas
iteration trough the nested array with v-for

I have a question regarding v-for. I have an object like below: enter image description here

and in dev console it look likes that: enter image description here

now my question is, how can I iterate through the each array and also the array inside the main array with v-for. I tried this solution but it didn't work.

thanks in advance!

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

0

Demo :

new Vue({
  el:"#app",
  data:{
    items: [{
        messageSettings: [{
        userOne: '1',
        userTwo: '2'
      }],
      profile: [{
        freelancerAbout: 'about1',
        freelancerName: 'name1'
      }],
      messages: [{
        id: 1,
        name: 'message1'
      }]
    }]
  }
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
    <div v-for="item in items" :key="item">
      <p v-for="msgSetting in item.messageSettings" :key="msgSetting">
        <span>UserOne: {{ msgSetting.userOne }}</span><br>
        <span>UserTwo: {{ msgSetting.userTwo }}</span>
      </p>
      <p v-for="profile in item.profile" :key="profile">
        <span>freelancerName: {{ profile.freelancerAbout }}</span><br>
        <span>freelancerName: {{ profile.freelancerName }}</span>
      </p>
    </div>
</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