From 285f7a5f5bd44baec3f2e8dc11c9c3c58dfc4e90 Mon Sep 17 00:00:00 2001 From: WeiYang Qiu Date: Fri, 31 Aug 2018 16:09:09 +0800 Subject: [PATCH] Update TableForm.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Save, add or cancel operation, edit status is not updated. 解决保存、新增、取消操作,编辑状态不更新bug。 --- src/routes/Forms/TableForm.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/Forms/TableForm.js b/src/routes/Forms/TableForm.js index 4e5142cc..51929c34 100644 --- a/src/routes/Forms/TableForm.js +++ b/src/routes/Forms/TableForm.js @@ -102,10 +102,10 @@ export default class TableForm extends PureComponent { }); return; } - const { data } = this.state; - const { onChange } = this.props; delete target.isNew; this.toggleEditable(e, key); + const { data } = this.state; + const { onChange } = this.props; onChange(data); this.setState({ loading: false, @@ -121,9 +121,9 @@ export default class TableForm extends PureComponent { const target = this.getRowByKey(key, newData); if (this.cacheOriginData[key]) { Object.assign(target, this.cacheOriginData[key]); - target.editable = false; delete this.cacheOriginData[key]; } + target.editable = false; this.setState({ data: newData }); this.clickedCancel = false; } -- GitLab