新增时,校验为空未通过,点击取消按钮。重新打开编辑,明明有值,显示校验未通过。
点击编辑
在新增编辑打开时初始化控件。
//显示编辑界面
handleEdit: function (index, row) {
this.$nextTick(() => {
this.$refs['form'].resetFields();
});
this.formTitle='编辑';
this.formVisible = true;
this.form = Object.assign({}, row);
},
//显示新增界面
handleAdd: function () {
//初始化控件校验。
this.$nextTick(() => {
this.$refs['form'].resetFields();
});
this.formTitle='新增';
this.formVisible = true;
this.form = {
name:'',
customerCategory:'',
loginUrl:'',
logoUrl:'',
systemTitle:'',
deadlineTime:'',
contacts:'',
phone:'',
description:'',
address:'',
memo:'',
industry:'',
};
},
问题解决。