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 {
    }
});
    原文作者:zackxizi
    原文地址: https://www.jianshu.com/p/36bd22333a70
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞