Error in v-on handler: “TypeError: Cannot read property ‘clearValidate‘ of undefined“

Error in v-on handler: “TypeError: Cannot read property ‘clearValidate‘ of undefined“_第1张图片
因为Dom元素没有加载完毕,导致refs取不到值,使用 $nextTick()

 this.$nextTick( ()=> {
     
    this.$refs['form'].clearValidate(['firstParty']);
  })

你可能感兴趣的:(Vue,clearValidate)