前端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. 记一次 .NET 某桌面奇侠游戏 非托管内存泄漏分析

    一:背景 1. 讲故事 说实话,这篇dump我本来是不准备上一篇文章来解读的,但它有两点深深的感动了我. 无数次的听说用 Unity 可做游戏开发,但百闻不如一见. 游戏中有很多金庸武侠小说才有的名字 ...

  2. Java-Bean Validation后端校验总结

    Validation Information resource: SpringBoot Docs: 2.8.9. @ConfigurationProperties Validation url: ht ...

  3. SpringBoot异步使用@Async原理及线程池配置

    前言 在实际项目开发中很多业务场景需要使用异步去完成,比如消息通知,日志记录,等非常常用的都可以通过异步去执行,提高效率,那么在Spring框架中应该如何去使用异步呢 使用步骤 完成异步操作一般有两种 ...

  4. MYSQL order by 排序的一个小问题探究

    小问题发现: select * from `sql` where id=1 order by (select 1 union select 2) 正常返回结果 mysql> select * f ...

  5. 洛谷P1090——合并果子(贪心)

    https://www.luogu.org/problem/show?pid=1090 题目描述 在一个果园里,多多已经将所有的果子打了下来,而且按果子的不同种类分成了不同的堆.多多决定把所有的果子合 ...

  6. mysql 复合索引 为什么遵循最左原则

    1,>mysql :多列索引  https://dev.mysql.com/doc/refman/5.7/en/multiple-column-indexes.html 1>,B+树: h ...

  7. PHP ASCII 排序方法

    //自定义ascii排序function ASCII($params = array()){ if(!empty($params)){ $p = ksort($params); if($p){ $st ...

  8. 深度理解JVM

      1. 环境搭建 安装jdk 2. 内存溢出场景模拟 public class Test01 { public static void main(String[] args) { //测试内存溢出 ...

  9. html jquery操作

    $(document).on('事件','元素',function(参数){ // 函数体 }) 元素获取方式:https://www.cnblogs.com/lixiuran/p/5316727.h ...

  10. DIVIDEMIX: LEARNING WITH NOISY LABELS AS SEMI-SUPERVISED LEARNING

    论文阅读: DIVIDEMIX: LEARNING WITH NOISY LABELS AS SEMI-SUPERVISED LEARNING 作者说明 版权声明:本文为博主原创文章,遵循CC 4.0 ...