表单点击编辑,再点击添加,数据无法清空问题
在使用dialog 弹框,点击编辑 再点击新增,由于数据数据已经赋值了, 所以this.$refs[addForm].resetFields(),无法把数据重置为空[] ,因此在下面还需要添加一个方法将input里面的数据逐一去除:
if (this.$refs['addForm'] !== undefined) {
this.$refs.addForm.resetFields()
}
for(let key in this.form){
this.form[key]=""
}