Vue Error in v-on handler: “TypeError: Cannot read property ‘resetFields’ of undefined”。【解决办法】

今天爱分享给大家带来Vue Error in v-on handler: “TypeError: Cannot read property ‘resetFields’ of undefined”。【解决办法】,希望能够帮助到大家。

原因:mouted加载table数据以后,隐藏的弹出框并没有编译渲染紧DOM里,所以click弹出$refs并没有获取到DOM元素,导致’resetFields’ of undefined。
解决方案:
方案1:

this.$nextTick(() => {
	this.$refs[formName].resetFields();
})

方案2:

if(this.$refs[formName] !=== undefined) {
	this.$refs[formName].resetFields();
}

原文链接:http://blog.itblood.com/1238.html,转载请注明出处。
0
【互动SLG/中文/动态】隔壁的美艳人妻V1.6.4 官方中文版+存档[大更新/追加新人物]【电脑/12.1G】
【互动SLG/中文/动态】隔壁的美艳人妻V1.6.4 官方中文版+存档[大更新/追加新人物]【电脑/12.1G】
10分钟前 有人购买 去瞅瞅看

站点公告

显示验证码
没有账号?注册  忘记密码?