TypeError: Cannot read property ‘resetFields‘ of undefined
this.$refs.addForm.resetFields();
addForm指的是要重置表单的ref值
也可以试试这种重置方式
if(this.$refs.form!=undefined){
this.$nextTick(()=>{
this.$refs['form'].clearValidate();
})
}
this.$refs.addForm.resetFields();
addForm指的是要重置表单的ref值
也可以试试这种重置方式
if(this.$refs.form!=undefined){
this.$nextTick(()=>{
this.$refs['form'].clearValidate();
})
}