Skip to content

Commit 3829063

Browse files
authored
Merge pull request #1 from liangxinhui/liangxinhui-patch-#1700
fix #1700
2 parents c8574d1 + 9e8d094 commit 3829063

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

components/table/demo/edit-row.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,17 @@ Table with editable rows.
106106
},
107107
save(key) {
108108
const newData = [...this.data];
109+
const newCacheData = [...this.cacheData];
109110
const target = newData.filter(item => key === item.key)[0];
110-
if (target) {
111+
const targetCache = newCacheData.filter(item => key === item.key)[0];
112+
if (target && targetCache) {
111113
delete target.editable;
112114
this.data = newData;
113-
this.cacheData = newData.map(item => ({ ...item }));
115+
Object.assign(
116+
targetCache,
117+
target
118+
);
119+
this.cacheData = newCacheData;
114120
}
115121
},
116122
cancel(key) {

0 commit comments

Comments
 (0)