前端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. Vue 路由跳转报错 Error: Avoided redundant navigation to current location: "/XXX".

    在router文件夹下的index.js中加入红色字体代码即可解决 import Vue from 'vue' import VueRouter from 'vue-router' Vue.use(V ...

  2. Nginx:多项目开发配置跨域代理

    简述Nginx应用场景(前后端) 当我们开发 vue 项目中可以通过 proxyTable 进行跨域,但如果是原生的 html+css+js ,或者其他没有跨域插件的项目中,想要跨域就要引入配置许多的 ...

  3. SprinBoot-SpringData-整合

    目录 SpringData 整合JDBC JDBCTemplate 整合Druid 配置数据源 配置Druid数据源监控 整合MyBatis 整合测试 整合Redis 测试整合 序列化配置 自定义re ...

  4. 源码编译安装 LNMP及论坛

    一.安装Nginx服务 systemctl stop firewalld systemctl disable firewalld setenforce 0 1.安装依赖包 yum -y install ...

  5. pyhton锁机制,进程池

    第一,进程锁,本来进程是各自的,本不要加锁,但是在屏幕上输出打印时为了防止混乱,在进程模块有一个锁函数,使用如下,需要说明是在py3以上版本没 有出现在过屏幕输出混乱,可以不加,这方法不重要,但是作为 ...

  6. 截断误差VS舍入误差

     截断误差:是指计算某个算式时没有精确的计算结果,如积分计算,无穷级数计算等,使用极限的形式表达的,显然我们只能截取有限项进行计算,此时必定会有误差存在,这就是截断误差. 舍入误差:是指由于计算机表示 ...

  7. 洛谷P1208——P1208 [USACO1.3]Mixing Milk(贪心)

    题目描述 由于乳制品产业利润很低,所以降低原材料(牛奶)价格就变得十分重要.帮助Marry乳业找到最优的牛奶采购方案. Marry乳业从一些奶农手中采购牛奶,并且每一位奶农为乳制品加工企业提供的价格是 ...

  8. PHP-设计模式之-中介者模式

    <?php//中介者模式 -- //抽象中介者abstract class UnitedNationa{ punlic abstract function Declared($message,c ...

  9. 微信小程序自动化测试

    使用官方工具 使用webview测试方法,当2019年被微信封禁 使用native定位

  10. pyqt5实现窗口跳转并关闭上一个窗口

    关键在于要定义一个关闭窗体的函数colsewin() 然后将按键与该函数连接(connect)在一起即可 import sys from PyQt5.QtWidgets import QMainWin ...