vue 数组对象取对象的属性: Cannot read property 'xxxx' of undefined
{{ list[0].name }}
list[0]没有定义
能正确打印出想要的结果,但就是报错,外面套个v-for就没错了 很费解
看到文章说是与异步有关,解决办法:
<template v-if=list[0]>
{{ list[0].name }}
</template>
{{ list[0].name }}
list[0]没有定义
能正确打印出想要的结果,但就是报错,外面套个v-for就没错了 很费解
看到文章说是与异步有关,解决办法:
<template v-if=list[0]>
{{ list[0].name }}
</template>