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

199
Views
get field value of array

I have the followig:

<div class="label">{{ item.data[0] }}</div>

and in the view I'm having the following:

{
  "id": 6,
  "firtname": "JHON ",
  "lastname": "SCALA",
  "fullname": "JHON  SCALA"
}

I justo want to show fullname

<div class="label">{{ item.data[0].fullname }}</div>

but I'm having this error

TypeError: Cannot read properties of undefined (reading 'fullname')

why????

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

If the data is being fetched from database or any other async persistence, vue can't read item.data[0].fullname before its loaded. Try wrapping the div in a v-if like this:

<template v-if="item.data.length > 0">
  <div class="label">{{ item.data[0].fullname }}</div>
</template>

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