首先在dialog上定义@close=“close1(‘form’)”
//第一种方式:全局清空表单数据
//全局清空表单数据
close1(form){
this.$refs[form].resetFields()
//清空图片数据
this.imageUrl = "";
}
//第二种方式:打开新增页面时全局清空表单数据
// 打开添加页面
openAdd(){
this.editVisible = true
//清空表单数据 brand为对象 循环将对象的key清空
for (var key in this.brand){
this.brand[key] = null
}
},
//第三种方式:打开新增页面时全局清空表单数据