Skip to content

Commit

Permalink
fix: 修复子表单编辑后无法还原之前表单数据bug @0.9.1-7
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed Mar 18, 2021
1 parent 05635ef commit d1c38a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "element-pro-crud",
"version": "0.9.1-6",
"version": "0.9.1-7",
"author": "BoBo<[email protected]>",
"main": "lib/ProCrud.umd.min.js",
"files": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ export default class GenerateSubForm extends Vue {
// 单行数据
inlineFormData = {}

// 原始数据
initialData = {}

mode: 'ADD' | 'EDIT' | 'DETAIL' | '' = 'DETAIL'

btnSaveIsLoading = false
Expand Down Expand Up @@ -189,6 +192,8 @@ export default class GenerateSubForm extends Vue {
}
row._mode = 'DETAIL';
this.mode = 'DETAIL';
// 取消后需要还原编辑前的数据
this.inlineFormData = this.initialData;
}

// 编辑当前行数据
Expand All @@ -200,6 +205,7 @@ export default class GenerateSubForm extends Vue {
row._mode = 'EDIT';
this.mode = 'EDIT';
this.inlineFormData = row;
this.initialData = row;
}

// 保存按钮点击
Expand Down

0 comments on commit d1c38a7

Please sign in to comment.