Skip to content

Commit

Permalink
fix: table demo bug #1700
Browse files Browse the repository at this point in the history
  • Loading branch information
liangxinhui authored and tangjinzhou committed Jan 15, 2020
1 parent 0244d21 commit 0dbea62
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/table/demo/edit-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,17 @@ Table with editable rows.
},
save(key) {
const newData = [...this.data];
const newCacheData = [...this.cacheData];
const target = newData.filter(item => key === item.key)[0];
if (target) {
const targetCache = newCacheData.filter(item => key === item.key)[0];
if (target && targetCache) {
delete target.editable;
this.data = newData;
this.cacheData = newData.map(item => ({ ...item }));
Object.assign(
targetCache,
target
);
this.cacheData = newCacheData;
}
},
cancel(key) {
Expand Down

0 comments on commit 0dbea62

Please sign in to comment.