有没有办法解决显示 id not defined on v-bind:key="persons.id" 的错误?
我的观点
<div v-for="reservation in reservationNameByTime" v-bind:key="reservation.id">
{{reservation.id}} /** displays 1 **/
<div v-for="player in reservation.Players" v-bind:key="player.id">
{{player.id}} /**displays 1 **/
<div v-for="persons in player.Person" v-bind:key="persons.id"> /** throws an error as id of null **/
{{persons.name}}
</div>
</div>
</div>
JSON数据
reservationNameByTime: [
{
id: 1, /** defines reservation id **/
Players: [
id: 1, /** defines players id **/
Person:{
id: 1, /** defines the person id **/
name: John
}
]
}
]
数组数据的图像

元芳怎么了
哔哔one
HUWWW
潇湘沐
随时随地看视频慕课网APP
相关分类