在使用的vue3+element-plus的项目中,我使用了form表单对数据进行校验。

但是使用了:

refDom.value.validate((valid) => {})
后,过一会控制台会报错: Cannot read property 'xxxx' of null,不管怎么定义,都会有这个问题。
后来发现是ref和reactive的原因。
使用reactive,控制台就不报错了,而且使用reactive的时候不需要使用value。
可是为什么呢?
因为ref是用来定义单一的数据类型,比如string,number,boolean等这样的。
reactive则是用来定义json,数组等类型的。
form表单很明显是属于json数据类型的,如果使用的话控制台是会报错的。

Cannot read property 'xxxx' of null的更多相关文章

  1. Cannot read property 'XXXX' of null/undifined

    这个问题可能的原因有很多 1.如果你的js直接写在自执行函数或者head标签内的script里面,那么可以检查一下你的代码有没有用到页面里的节点,因为这样写的代码在页面加载完成之前就会开始执行,如果有 ...

  2. 百度ueditor 实例化 Cannot set property 'innerHTML' of null 完美解决方案

    此时此刻,我正在用博客园推荐的TinyMCE编辑器写这个博客,突然想起最近在项目中使用百度ueditor编辑器中的一些经历.所以记录在此,与大家分享. 不得不说,百度ueditor是一款很好的在线编辑 ...

  3. org.hibernate.PropertyValueException: not-null property references a null or transient value:

    org.hibernate.PropertyValueException: not-null property references a null or transient value: com.bj ...

  4. Uncaught TypeError: Cannot read property 'insertAdjacentHTML' of null

    在开发Ext 项目中如果遇到 Uncaught TypeError: Cannot read property 'insertAdjacentHTML' of null 这个错误,检查下renderT ...

  5. Extjs4---Cannot read property 'addCls' of null

    用MVC做后台管理系统时遇到的问题,关于tab关闭后再打开不显示,或者报错 我在新的tabpanel中加入了一个grid,当我关闭再次打开就会报错Cannot read property 'addCl ...

  6. extjs Cannot read property 'dom' of null

    如果你的EXTJS报错: Cannot read property 'dom' of null,那就有可能是因为你的HTML或者JSP文件中的BODY标签里面少了个东西比如代码是: <html& ...

  7. Uncaught TypeError: Cannot set property 'innerHTML' of null

    学习Chrome插件时,要在弹出页面中显示当前时间,结果怎样也显示不出来 看了 http://www.cnblogs.com/mfryf/p/3701801.html 这篇文章后感悟颇深 通过调试发现 ...

  8. hibernate级联保存问题,出错not-null property references a null or transient value

    Servlet.service() for servlet default threw exception org.hibernate.PropertyValueException: not-null ...

  9. Extjs4---Cannot read property 'addCls' of null - heirenheiren的专栏 - 博客频道 - CSDN.NET

    body { font-family: 微软雅黑,"Microsoft YaHei", Georgia,Helvetica,Arial,sans-serif,宋体, PMingLi ...

  10. 错误:Cannot set property 'innerHTML' of null

    360浏览器代码编辑器里提示错误:Cannot set property 'innerHTML' of null 原因是代码执行时要调用的内容不存在

随机推荐

  1. Python博客导航

    第一部分 - Python程序设计基础 第一章 - Python介绍 1.1 - Python简介 1.2 - Python准备 1.2 - 创建虚拟环境 第二章 - Python基础(建设中) 2. ...

  2. C++Day09 深拷贝、写时复制(cow)、短字符串优化

    一.std::string 的底层实现 1.深拷贝 1 class String{ 2 public: 3 String(const String &rhs):m_pstr(new char[ ...

  3. JDK9对集合添加的优化-Debug追踪

    JDK9对集合添加的优化 通常,我们在代码中创建一个集合(例如,List或Set ),并直接用一些元素填充它.实例化集合,几add方法调用,使得代码重复. package A_Lian_one.dem ...

  4. jmeter性能监控

    jmeter监控内存,CPU等方法 (2018-06-26 15:39:37) 转载▼   分类: 性能测试 方法1:使用插件来监控CPU,内存等的使用情况1.需要的插件准备JMeterPlugins ...

  5. Docker安装elasticsearch、kibana

    一.Docker 安装elasticsearch 7.10 1. 拉取镜像 docker pull docker.elastic.co/elasticsearch/elasticsearch:7.10 ...

  6. Jetson Nano更改软件源

    Jetson Nano 采用的是 aarch64 架构的Ubuntu 18.04.2 LTS 系统 sudo vim /etc/apt/sources.list deb http://mirrors. ...

  7. 2 .NET Core笔试题

    1.说说在Linux系统部署ASP.NET Core项目的步骤. 2.说说热重载是什么. 3.如何理解鉴权和授权两个词 4.说说.NET7包含了几大方向的开发? 5.如何理解云原生? 6.ASP.NE ...

  8. Cesium源码之flyTo(一)

    1 /** 2 * Flies the camera from its current position to a new position. 3 * 4 * @param {Object} opti ...

  9. ubuntu 20.04 远程桌面(win10 控制 Ubuntu 20.04)

    转载csdn: https://blog.csdn.net/lucky7213/article/details/107008246/

  10. MySQL索引的基本理解

    之前一致以为索引就是简单的在原表的数据上加了一些编号,让查询更加快捷.后来发现里面还有更深的知识. 索引用于快速查找具有特定列值的行.如果没有索引,MySQL 必须从第一行开始,然后通读整个表以找到相 ...