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

时间:2020-10-27 13:53:42   收藏:0   阅读:1163

方法来源

首先确认 

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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!