Using this.$refs to report errors in vue+typescript projects

vue,element-ui,typescript is used in the project. this.$ refs [formName] .validate () will have tslint error

when calling the form validation function provided by element-ui

clipboard.png

:

clipboard.png

1 saw the problem on codeshelper: https://codeshelper.com/q/10., but didn"t know exactly how to declare the type to this.$refs . How does element-ui introduce type declarations?


https://github.com/vuejs/vue-.


$refs: {

validate: HTMLFormElement

}

Menu