-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Table的【可编辑行】示例代码,"修改多行,仅保存1行时",逻辑有问题 #1700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
1 task done
liangxinhui opened this issue
Jan 8, 2020
· 3 comments
· Fixed by liangxinhui/ant-design-vue#1 or #1704
Closed
1 task done
Table的【可编辑行】示例代码,"修改多行,仅保存1行时",逻辑有问题 #1700
liangxinhui opened this issue
Jan 8, 2020
· 3 comments
· Fixed by liangxinhui/ant-design-vue#1 or #1704
Labels
Comments
Save 的时候,应该用 cacheData 作为基础数据。然后把当前行的修改刷新进去。 |
我尝试做了修改,目前看起来是正常的: 原代码: save(key) {
const newData = [...this.data];
const target = newData.filter(item => key === item.key)[0];
if (target) {
delete target.editable;
this.data = newData;
this.cacheData = newData.map(item => ({ ...item }));
}
}, 修改为: save(key) {
const newData = [...this.data];
const newCacheData = [...this.cacheData];
const target = newData.filter(item => key === item.key)[0];
const targetCache = newCacheData.filter(item => key === item.key)[0];
if (target && targetCache) {
delete target.editable;
this.data = newData;
Object.assign(
targetCache,
target
);
this.cacheData = newCacheData;
}
}, |
liangxinhui
added a commit
to liangxinhui/ant-design-vue
that referenced
this issue
Jan 9, 2020
liangxinhui
added a commit
to liangxinhui/ant-design-vue
that referenced
this issue
Jan 9, 2020
tangjinzhou
pushed a commit
that referenced
this issue
Jan 15, 2020
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Version
1.4.10
Environment
windows10, Microsoft Edge 79.0.309.58 , Vue 2.6.10
Reproduction link
Steps to reproduce
Edit
。并修改What is expected?
1行保存修改,另1行返回原来的值。
What is actually happening?
两行都执行了修改。取消无效
The text was updated successfully, but these errors were encountered: