Typescript in vue - Property 'validate' does not exist on type 'Vue | Element | Vue[] | Element[]'.

后端 未结 5 1763
感动是毒
感动是毒 2020-12-23 17:38

I created v-form like this


  ...
  

        
5条回答
  •  旧巷少年郎
    2020-12-23 18:05

    Couldn't comment on the accepted solution since I'm new to StackOverflow and wanted to provide my solution to this. I took the same initial step to investigate as OP and did a console.log(this.$ref.form), the output on the console is actually an array of [VueComponent] and validate() function doesn't exist in that context.

    I was able to access the validate() function on the form by doing this.$ref.form[0].validate()

提交回复
热议问题