vue表单校验提交报错TypeError: Cannot read property 'validate' of undefined


TypeError: Cannot read property 'validate' of undefined at VueComponent.submitForm (plat_users.html:385) at Proxy.boundFn (vue.js:130) at click (eval at makeFunction (vue.js:8480), <anonymous>:2:5611) at VueComponent.invoker (vue.js:1948) at VueComponent.Vue.$emit (vue.js:2549) at VueComponent.handleClick (element-ui.js:3) at boundFn (vue.js:130) at HTMLButtonElement.invoker 

原因是 @click="submitForm(ruleForm)" 中的 ruleForm 没有使用引号。

正确写法:

<el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM