Error in v-on handler: "TypeError: Cannot read property 'clickData' of undefined"

方法来源

首先确认 

this.$refs[formName].validate((valid) => {

$ref 和 $refs 中名称相同

<ContentsUp ref="ContentsUp" :keyItemUrl="keyItem"/>
--------------
this.$refs.ContentsUp.clickData();

然后添加$nextTick
this.$nextTick(function () {
this.$refs.ContentsUp.clickData();
});

此时修复报错!
原文地址:https://www.cnblogs.com/qiangqiangpeng/p/13884242.html