今天爱分享给大家带来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();
}
原文链接:https://blog.itblood.com/1238.html,转载请注明出处。

![我的新生活:重置0.96 [神作RPG/AI汉化/动态]](/wp-content/uploads/replace/2025/07/18/791b368191d45396167bbcebb5412ae0.webp)