
Error in v-on handler: "TypeError: Cannot read properties of undefined (reading 'validate')"
解决:
1、传值的时候,要带引号
<el-button type="primary" @click="onExec('formData')">执行SQL</el-button>
2、传的值要和ref一致
3、验证语句写法
this.$refs[formName].validate((valid) =>{})
本文解决了在使用Vue框架时遇到的TypeError: Cannot read properties of undefined(reading 'validate')错误。通过确保点击事件中传递参数时加引号、保持传递值与ref一致以及正确书写验证方法,可以有效避免这一问题。

Error in v-on handler: "TypeError: Cannot read properties of undefined (reading 'validate')"
解决:
1、传值的时候,要带引号
<el-button type="primary" @click="onExec('formData')">执行SQL</el-button>
2、传的值要和ref一致
3、验证语句写法
this.$refs[formName].validate((valid) =>{})
9938
2143
1421

被折叠的 条评论
为什么被折叠?
