前端vue报错 [Vue warn]: Error in render: "TypeError: Cannot read properties of null (reading 'name')" found in         ****** 返回值接收时出Type错误往下翻

这个错误是不能加载属性为null的类型 我用了一个笨办法,把页面上的null值都ctrl+f标注出来然后都修改成0(0方便写点),然后我发现当前页面的错误并没有改变,最后我定位到了错误再我调用的子组件里面,我调用的是一个弹窗

当我把这个引用删除的时候就不报错了,也就是说我引用的时候出现了错误
我又用笨办法定位,把所有null属性的值改为有值的。这个时候我的错误提示就出现了变化
最后定位到我接收的属性从nulll改为[],这也是我的马虎导致的问题

改为

                        还有一种就是访问接口返回值接收时出Type错误

export default {
data() {
return {
tableData: null,
}, methods: {
search() {this.axios.post("/api/xxx/xxx", this.filter).then((res) => {
this.tableData = res.data;//一般来说都是这里返回值错误 });
},

比如使用的时候

          <el-button-group class="pull-right">
<el-button
size="medium"
type="primary"
@click="gotoAdd(tableData.length)"
>xx</el-button
>

这个时候就会报错误 当 res.data为空时,那   this.tableData就等于null  这个时候你对 TableData做任何事情都是会报错,请注意这一点小细节

  methods: {
search() {this.axios.post("/api/xxx/xxx", this.filter).then((res) => {
if(res.data!=null){//一般来说都是这里返回值错误
this.tableData = res.data;
}
});
},

不要让他赋值进去就行

希望能帮助到你

Vue 报错Error in render: “TypeError: Cannot read properties of null (reading ‘xxx’)” found in的更多相关文章

  1. Vue报错: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'protocol')

    Vue报错: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'protocol') 报错信 ...

  2. vue报错Error in render: "TypeError: Cannot read property '0' of undefined"

    通常有两种情况: 1.在模板的html标签上使用length报错 vue 中使用 length判断的时候,有时会报错,如下: <div class="item_list" v ...

  3. vue报错-Error: Cannot find module '@babel/core'

    vue之webpack实战的时候遇到报错,Error: Cannot find module '@babel/core' 这报错,我百度了很久,后来发现报错里面有提示,发现是我的 babel-load ...

  4. vue报错Error in v-on handler: "RangeError: Maximum call stack size exceeded"

    看下面的报错 错误 看到这个错误一脸懵逼.后面了解到,是因为程序进入了死循环,后面检查了我的代码,原来在这里自己调用自己

  5. vue报错 error: data.push is not a function

    data定义出错,data需定义为一个数组 => data : [ ]

  6. [Android]通过js方法回调部分native报错 Web Console: Uncaught TypeError: Object [object Object] has no method 'xxx'

    在android4.2以前,注入步骤如下: webview.getSetting().setJavaScriptEnable(true); class JsObject { public String ...

  7. [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 ...

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

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

  9. vue 表单校验报错 "Error: please transfer a valid prop path to form item!"

    vue 表单校验报错 "Error: please transfer a valid prop path to form item!" 原因:prop的内容和rules中定义的名称 ...

随机推荐

  1. openswan IPSec专栏目录锦集

    为了方便查阅现有的文章,特准备一个目录页供后续查询使用 专栏序言 1. 基础知识 openswan任务调度基础知识之信号 2. openswan环境搭建 openswan框架和编译时说明 opensw ...

  2. inet_aton和inet_ntoa

    3.1 inet_aton() int inet_aton(const char *cp, struct in_addr *inp); 参数说明: cp : IPv4点分十进制字符串,例如" ...

  3. LayoutControl控件使用

    因默认外边距过大需要将外边距缩小用以下代码实现layoutControlGroup1.Padding = DevExpress.XtraLayout.Utils.Padding.Empty;是否允许只 ...

  4. ABP VNext发布遇到的坑

    本地调试没有问题,发布后通过Token调用其他API时,出现返回JSON中提示:Authorization failed! Given policy has not granted. 需要修改apps ...

  5. js实现钟表

    在网页上显示一个钟表 html: <body onload="startTime()"> <div id="txt"></div& ...

  6. 回收Windows 10恢复分区之后的磁盘空间

    我电脑上安装了Windows 10和Linux双系统,现在将Linux删除之后,准备将其磁盘空间并入到Windows 10的C盘中,但是发现C盘跟Linux空间之间还隔了一个Windows的恢复分区, ...

  7. expression select表达式动态构建

    参考: http://blog.csdn.net/tastelife/article/details/7340205 http://blog.csdn.net/sweety820/article/de ...

  8. git实战-linux定时监控github更新状态(二)

    系列文章 git介绍-常用操作(一)✓ git实战-linux定时监控github更新状态(二)✓ 本文主要内容 如何查看github的本地仓库和远程仓库的同步情况 linux服务器定时监控githu ...

  9. php实现实例化类后自动进行错误以及异常处理(简易版)

    <?php class App { public function __construct() { /* * ini_set 设置配置项 * display_errors 是否在页面显示错误信息 ...

  10. Docker DevOps实战:Docker+Jenkins+Python+Pytest+Allure(2)- Jenkins初始化、Jenkins插件、Jenkins配置、自动化测试

    Jenkins初始化 step-1 访问Jenkins http://ip:80  step-2 查看密码.输入密码 # 方式一:通过查看容器日志 [root@localhost ~]# docker ...