修复店铺分类可能为undefined问题

master
paulGao 2022-09-07 17:58:14 +08:00
parent 62d8d121c6
commit 2792df38c0
1 changed files with 4 additions and 4 deletions

View File

@ -152,7 +152,7 @@ export default {
this.formAdd.labelName = "";
this.showParent = true;
delete this.formAdd.id;
this.formAdd.parentId = v.id;
this.formAdd.parentId = v.id || 0;
this.modalVisible = true;
},
//
@ -162,7 +162,7 @@ export default {
this.formAdd.id = v.id;
this.formAdd.labelName = v.labelName;
this.formAdd.level = v.level;
this.formAdd.parentId = v.parentId;
this.formAdd.parentId = v.parentId || 0;
this.formAdd.sortOrder = v.sortOrder;
this.showParent = false;
this.modalVisible = true;
@ -176,7 +176,8 @@ export default {
this.showParent = true;
delete this.formAdd.id;
this.formAdd.parentId = 0;
this.formAdd.sortOrder = 1
this.formAdd.sortOrder = 1;
this.formAdd.level = 0;
this.modalVisible = true;
},
@ -185,7 +186,6 @@ export default {
this.$refs.formAdd.validate(valid => {
if (valid) {
this.submitLoading = true;
console.log(this.formAdd);
if (this.modalType === 0) {
// id
delete this.formAdd.id;