Cannot read properties of undefined (reading ‘validate‘)“

1、注意两个地方

1、ref前面 加冒号“:”,还是不加冒号。

2、this.$refs[value].validate()=>(),更改为this.$refs[value].validate()=>(),

不排除this.$refs[value].validate()=>(),有时候不会报错

2、示范代码

<el-form ref="value" :model="getAppForm" label-width="120px" :rules="rules"

1

data(){},

methids:{

makeSure() {

this.$refs.value.validate((valid)=>{

if(valid){

})

}

}

图片[1] - Cannot read properties of undefined (reading ‘validate‘)“ - MaxSSL

图片[2] - Cannot read properties of undefined (reading ‘validate‘)“ - MaxSSL

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享