首页 > 其他分享 >Cannot read properties of null (reading ‘insertBefore‘)

Cannot read properties of null (reading ‘insertBefore‘)

时间:2022-09-23 10:44:23浏览次数:44  
标签:el null insertBefore read Cannot 报错 table reading

在使用element-plus的el-table组件的时候,如果v-if使用不当,发到线上会报错:

 

但是在本地是不会报错的,网上找了很多大概就是因为在el-table-column里面使用v-if的判断,造成了空指针的原因。

但是经过我测试后发现并不只是if的原因,改为v-show和 || 运算符照样出问题。

最后经过反复测试发现,是在column里面使用了一个方法,这个方法没有对数据进行非空判断造成的。

所以除了if判断之外,我们还需要注意自定义方法的使用

标签:el,null,insertBefore,read,Cannot,报错,table,reading
From: https://www.cnblogs.com/sixrookie/p/16720456.html

相关文章