{{ 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的更多相关文章

  1. vue数组对象修改触发视图更新

    直接修改数组元素是无法触发视图更新的,如 this.array[0] = { name: 'meng', age: 22 } 修改array的length也无法触发视图更新,如 this.array. ...

  2. [Vue warn]: Error in render: "TypeError: Cannot read property '0' of undefined、vuejs路由使用的问题Error in render function

    1.[Vue warn]: Error in render: "TypeError: Cannot read property '0' of undefined 注意,只要出现Error i ...

  3. vue.common.js?e881:433 TypeError: Cannot read property 'nodeName' of undefined

    我觉得吧,是这么个原因,就是响应式要找这个node改它的内容,没找着,就报错了. 用computed监控vuex的state属性,绑定到页面上,如果这个属性改了,因为响应式,那么就要更改页面,如果页面 ...

  4. vue 报错解决:TypeError: Cannot read property '_t' of undefined"

    前端报错如下: [Vue warn]: Error in render: "TypeError: Cannot read property '_t' of undefined" 是 ...

  5. vue给对象新添加属性,一定要使用Vue.set( target, key, value )这个API来添加

    this.tagList = [{ id:1, tagName:'90后' }, { id:2, tagName:'土豪' }, { id:3, tagName:'美女' }, { id:4, tag ...

  6. js 向数组对象中添加属性和属性值

    let resultList = [{"name":"a1"},{"name":"b1"}] resultList.fo ...

  7. VUE.JS 使用axios数据请求时数据绑定时 报错 TypeError: Cannot set property 'xxxx' of undefined 的解决办法

    正常情况下在data里面都有做了定义 在函数里面进行赋值 这时候你运行时会发现,数据可以请求到,但是会报错 TypeError: Cannot set property 'listgroup' of ...

  8. 记录下vue 中引用echarts 出现 "TypeError: Cannot read property 'getAttribute' of undefined"问题

    今天做项目,用echarts展示数据 ,自己测试 先测试 了下.写的代码html: <div ref="myChart" style="height:300px;w ...

  9. Vue tools开发工具报错Cannot read property '__VUE_DEVTOOLS_UID__' of undefined

    使用 vue tools 开发工具,不显示调试面板中的组件,点击控制台报错: Cannot read property 'VUE_DEVTOOLS_UID' of undefined 在 main.j ...

随机推荐

  1. 在不切换分支的情况下,如何在all branches中快速查看指定分支,相对其他分支的状态

    假设需要查看的分支为temp 1.git show temp 通过这个可以拿到commit id 2.查看TortoiseGit的日志,左下角勾选所有分支 3.在日志界面搜索commit id,然后右 ...

  2. 表单Content-Type为multipart/form-data时,后台数据的接收

    我们在写form提交表单的时候,后台大多数用request.getParameter的方式来接收前台输入的数据.但如果我们表单中提交的数据包含file文件传输的话,我们需要将Content-Type改 ...

  3. Wamp 升级php7.3报错

    电脑系统:win10 Wamp版本: WampServer Version 3.0.4 32bit Apache 2.4.18 - PHP 7.3.7 - MySQL 5.7.11 PHP 5.6.1 ...

  4. 【Maven】为什么Maven dependencies有的jar包显示为灰色?

    因为它们的scope被限制住了,放开就恢复为亮白色. 来两张图片比对一下就清楚了: 没有限制scope,是正常的亮白色. 限制scope为test,显示为灰黑色. 其实颜色不重要,重要的是scope会 ...

  5. 使用Neo4j分析《权力的游戏》

    几个月前,数学家 Andrew Beveridge和Jie Shan在数学杂志上发表<权力的网络>,主要分析畅销小说<冰与火之歌>第三部<冰雨的风暴>中人物关系,其 ...

  6. osg模型部分节点旋转

    osg::ref_ptr<osg::Geode> CreateBox() { osg::ref_ptr<osg::Geode> geode = new osg::Geode; ...

  7. LeetCode_168. Excel Sheet Column Title

    168. Excel Sheet Column Title Easy Given a positive integer, return its corresponding column title a ...

  8. jQuery学习四——效果

    1.显示,隐藏: <!DOCTYPE html> <html> <head> <title>jquery事件</title> </he ...

  9. json转字符串 —— jsonObj.toJSONString()与JSON.stringify(jsonObj)json to string

    json 转变成 string方法介绍: var people = { "programmers": [{ "firstName": "Brett&q ...

  10. conda安装的国内镜像配置,实现快速下载

    conda安装的国内镜像配置,实现快速下载 anaconda的所有的软件包全部在国外,安装起来很麻烦,关键是下载速度慢,而且经常中断,所以需要配置国内安装的镜像,下载速度就很快了. 一.conda换国 ...