TypeError: Cannot read properties of undefined (reading 'day')
TypeError: Cannot read properties of undefined (reading '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>
无序列表显示日、月、年键及其值,但它们在日期中未定义 div。
**somehow what was needed was to iterate the object like this**
<div class="day">
<div v-for="(value) in dayappointment.visit" :key="value"
class="dayboxes">
{{value}}
</div>
</div>
<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>
无序列表显示日、月、年键及其值,但它们在日期中未定义 div。
**somehow what was needed was to iterate the object like this**
<div class="day">
<div v-for="(value) in dayappointment.visit" :key="value"
class="dayboxes">
{{value}}
</div>
</div>