Home  >  Q&A  >  body text

TypeError: Cannot read property of undefined (read 'day')

<div class="cont">
    <ul>
        <li v-for="(value, key) in dayappointment.visit" :key="value">
            {{ key }}: {{ value }}
        </li>
    </ul>
    <div class="day">
        <div class="dayboxes">
            {{dayappointment.visit.day}}
        </div>
        <div class="dayboxes">
            {{dayappointment.visit.month}}
        </div>
        <div class="dayboxes">
            {{dayappointment.visit.year}}
        </div>
    </div>
</div>

The unordered list shows the day, month, year keys and their values, but they are undefined in the day div.

P粉276064178P粉276064178185 days ago442

reply all(1)I'll reply

  • P粉133321839

    P粉1333218392024-04-01 16:21:26

    **somehow what was needed was to iterate the object like this**              
       
    {{value}}

    reply
    0
  • Cancelreply