首页 > 编程语言 > 详细

vue 数组对象取对象的属性: Cannot read property 'xxxx' of undefined

时间:2018-06-01 00:05:55      阅读:1435      评论:0      收藏:0      [点我收藏+]

{{ list[0].name }}

list[0]没有定义

能正确打印出想要的结果,但就是报错,外面套个v-for就没错了 很费解

与异步有关,解决办法:
    <template v-if=list[0]>
        {{ list[0].name }}
    </template>

https://www.v2ex.com/amp/t/402145

vue 数组对象取对象的属性: Cannot read property 'xxxx' of undefined

原文:https://www.cnblogs.com/hehecat/p/9119696.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!