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 ...
随机推荐
- python和go对比字符串的链式处理
一.什么是链式处理 对数据的操作进行多步骤的处理称为链式处理,链式处理器是一种常见的编程设计,链式处理的开发思想将数据和操作拆分,解耦,让开发者可以根据自己的技术优势和需求,进行系统开发,同时将自己的 ...
- org.apache.ibatis.binding.BindingException: Parameter 'xxx' not found. Available parameters are [arg1, arg0, param1, param2]
这个异常说明参数没有加上@Param注解,加上这个注解就行了. 默认情况下mybatis把参数按顺序转化为[0, 1, param1, param2],也就是说#{0} 和 #{param1} 是一样 ...
- PAT甲级——A1113 Integer Set Partition
Given a set of N (>) positive integers, you are supposed to partition them into two disjoint sets ...
- 1day:了解python
一.’计算机语言有哪些? 1.开发语言: 高级语言:Python,Java,PHP,C#,C++,(面向字节码) 低级语言:C.汇编(面向机器码) 备注:机器码是直接和计算机硬件沟通,字节码是通过解释 ...
- <day001>存储到Mysql、mongoDB数据库+简单的Ajax请求+os模块+进程池+MD5
任务1:记住如何存储到Mysql.mongoDB数据库 ''' 存储到Mysql ''' import pymysql.cursors class QuotePipeline(object): def ...
- scrpy--分布式爬虫
原来的scrapy中的Scheduler维护的是当前机器中的任务队列(存放着Request对象以及回调函数等信息) + 当前的去重队列(存放访问过的url地址) 实现分布式的关键就是需要找一台专门的主 ...
- selenium基础(多表单切换、多窗口切换)
一.多表单的切换 frame:HTML页面中的一中框架,主要作用是在当前页面中指定区域显示另一页面元素: (HTML语言中,frame/iframe标签为表单框架) 在web ...
- 测试环境添加spark parcel 2.1步骤
1.先到http://archive.cloudera.com/spark2/parcels/2.1.0.cloudera1/ 下载需要的文件比如我linux版本需要是6的 hadoop6需要下载这些 ...
- Widget Factory
Widget Factory 有N种零件,生产所需天数都为3~9天,有M条记录,记录开工星期几,和停工星期几,并告诉你这条记录所加工的零件,求每种零件的生产时间,\(1≤N,M≤300\). 解 显然 ...
- P1082 同余方程(扩欧模板)
https://www.luogu.org/problem/P1082 #include <iostream> #include <cstdio> #include <q ...