Property 'validate' does not exist on type 'Element | Element[] | Vue | Vue[]'. Property 'valid...
使用vue-cli 3.0+Element-ui时候,调用form表单校验时候出现的问题是:
Property 'validate' does not exist on type 'Element | Element[] | Vue | Vue[]'. Property 'validate' does not exist on type 'Element'.
解决方案
(this.$refs.form as any).validate((valid: boolean) => {
if (valid) {
} else {
}
});
博客看自:https://blog.csdn.net/weixin_34117522/article/details/86810945
Property 'validate' does not exist on type 'Element | Element[] | Vue | Vue[]'. Property 'valid...的更多相关文章
- 解决TS报错Property 'style' does not exist on type 'Element'
在使用queryselector获取一个dom元素,编译时却报错说property 'style' does not exist on type 'element'. 原因:这是typescript的 ...
- React报错之Property 'X' does not exist on type 'HTMLElement'
正文从这开始~ 总览 在React中,当我们试图访问类型为HTMLElement 的元素上不存在的属性时,就会发生Property 'X' does not exist on type 'HTMLEl ...
- React报错之Property 'value' does not exist on type 'HTMLElement'
正文从这开始~ 总览 当我们试图访问一个类型为HTMLElement的元素上的value属性时,会产生"Property 'value' does not exist on type 'HT ...
- react中使用typescript时,error: Property 'setState' does not exist on type 'Home'
问题描述: 我在react中用typescript时,定义一个Home组件,然后在组件里用setState时会有这样一个报错:(如图)Property 'setState' does not exis ...
- React报错之Property 'value' does not exist on type EventTarget
正文从这开始~ 总览 当event参数的类型不正确时,会产生"Property 'value' does not exist on type EventTarget"错误.为了解决 ...
- vue element-ui typescript tree报错 === Property 'getCheckedNodes' does not exist on type 'Element | Element[] | Vue | Vue[]'.
import { Tree } from 'element-ui' const ref = <Tree>this.$refs.tree ref.getCheckedNodes()
- [ts] Property 'aaa' does not exist on type 'Window' 解决办法
第一种: (window as any).aaa 第二种: declare global { interface Window { aaa: any; } } window.aaa = window. ...
- TypeScript 错误property does not exist on type Object
TypeScript 错误property does not exist on type Object 在TypeScript中如果按JS的方式去获取对象属性,有时会提示形如Property 'val ...
- 在angular项目中使用bootstrap的tooltip插件时,报错Property 'tooltip' does no t exist on type 'JQuery<HTMLElement>的解决方法和过程
在angular4的项目中需要使用bootstrap的tooltip插件. 1. 使用命令安装jQuery和bootstrap npm install bootstrap jquery --save ...
随机推荐
- redis笔记_源码_字典dict
参考:https://redissrc.readthedocs.io/en/latest/datastruct/dict.html Expand: 条件: 新的table 大小: Rehash: 条件 ...
- CSS3——伸缩布局及应用
CSS3在布局方面做了非常大的改进,使得我们对块级元素的布局排列变得十分灵活,适应性非常强,其强大的伸缩性,在响应式开中可以发挥极大的作用. 主轴:Flex容器的主轴主要用来配置Flex项目,默认是水 ...
- Orika JavaBean映射工具探秘
Orika是一个简单.快速的JavaBean拷贝框架,Orika使用字节代码生成来创建具有最小开销的快速映射器. 关于: 作为开发人员,我们必须为业务问题提供解决方案,我们希望利用我们的时间来做真正重 ...
- Vue+Iview+Node 搭建数据模拟接口
1.初始化node 项目 2.安装需要部件 3.编写简单代码 routers=>:index.js login.js users.js 根目录 index.js var express=re ...
- eax,ebx,ecx,edx,esi,edi,ebp,esp寄存器的作用
位的寄存器.如果用C语言来解释,可以把这些寄存器当作变量看待. 比方说:add eax,-2 ; //可以认为是给变量eax加上-2这样的一个值. 位寄存器有多种用途,但每一个都有"专长 ...
- linux大神
http://blog.csdn.net/skykingf/article/category/780616
- day 83 Vue学习之五DIY脚手架、webpack使用、vue-cli的使用、element-ui
Vue学习之五DIY脚手架.webpack使用.vue-cli的使用.element-ui 本节目录 一 vue获取原生DOM的方式 二 DIY脚手架 三 vue-cli脚手架的使用 四 we ...
- java编程规约二
四.OOP规约(Object Oriented Programming,面向对象设计) 1.静态变量和静态方法直接用类名访问,不要再new 对象去访问 2.方法覆盖必须加@Override注解 3.尽 ...
- <Python基础>列表的基本操作
s = 'abCDeFg aBcDea' s1 = s.split('D',3) #以s1列表为例 print(s1) #增 s1.append('foxabc') #返回值None,直接增到列表的最 ...
- ADS 下 flash 烧写程序原理及结构
本原理:在 windows 环境下借助 ADS 仿真器将在 SDRAM 中的一段存储区域中的数据写到 Nand flash 存 储空间中.烧写程序在纵向上分三层完成: 第一层: 主烧写函数(完成将在 ...