2

Vue.js 报错 : Cannot read property 'validate' of undefined

 2 years ago
source link: https://segmentfault.com/a/1190000040633161
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

报错提示信息:

TypeError: Cannot read property 'validate' of undefined

解决:**

解析: 错误导致的原因是 el-form表单中的 ref="dataForm"和表单提交时this.$refs.dataForm.validate()名字交的不一致,或者是ref这个就没有定义.

我是因为名字起的不一致而导致报错的,下次要细心啦


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK