vue:error Cannot read property 'length' of undefined
2020-03-01 02:50
751 查看
vue:error Cannot read property ‘length’ of undefined
#主要是在浏览器渲染页面时,dataList 为null dataList.length为undefined ,这个要着重处理 v-for 里面的对象数据
1、v-for循环类,加v-if 判断一下 列表是否为null
2、再则看看文件内接口是否取到数据进行一下判断,取到把data值赋给对象,没取到,提示没取到
3、处理数据最好是在created 里面初始化,mounted 加载模板时数据可以直接取到,不容易出错
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- vue项目中的报错问题TypeError: Cannot read property 'Length' of undefined
- vue出现TypeError: Cannot read property '__ob__' of undefined的解决
- Uncaught TypeError: Cannot read property 'length' of undefined
- jquery-2.1.4.min.js:69 Uncaught TypeError: Cannot read property 'length' of undefined
- Uncaught TypeError: Cannot read property 'length' of undefined
- vue-cli3的项目 CDN链接报错解决 Uncaught TypeError: Cannot read property 'prototype' of undefined at Object.
- vuecli3+typescript 错误信息: TypeError: Cannot read property 'extend' of undefined
- VUE中出现 Cannot read property 'length' of undefined 的错误
- vue Uncaught TypeError: Cannot read property 'gc' of undefined
- vue项目中Error in render function: "TypeError: Cannot read property 'matched' of undefined"
- Uncaught TypeError: Cannot read property 'length' of undefined
- vue 国际化在弹出框中$t()报错:TypeError: Cannot read property '_t' of undefined
- Uncaught TypeError: Cannot read property 'length' of undefined
- vue2.x中数组length属性报错的问题Error in render: cannot read property 'length' of undefined
- 使用JQuery插件DataTables,报错:Uncaught TypeError: Cannot read property 'length' of undefined
- Uncaught TypeError: Cannot read property 'msie' of undefined
- Uncaught TypeError: Cannot read property 'msie' of undefined
- qml TypeError: Cannot read property 'xxx' of undefined 错误处理
- XX商城all.js:329 Uncaught TypeError: Cannot read property 'offse 4000 tWidth' of undefined
- jQuery mobile报错 Uncaught TypeError: Cannot read property 'concat' of undefined