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

181
Views
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 answers
Answer question

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 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!