From 4a87502da55a2a2acfb0bd515e3afb3acf271ada Mon Sep 17 00:00:00 2001 From: jim chen Date: Thu, 18 Jan 2018 10:01:26 +0800 Subject: [PATCH] add Debounce fix #744 --- src/routes/Forms/TableForm.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/routes/Forms/TableForm.js b/src/routes/Forms/TableForm.js index 12c7afbd..d5494267 100644 --- a/src/routes/Forms/TableForm.js +++ b/src/routes/Forms/TableForm.js @@ -1,4 +1,6 @@ import React, { PureComponent } from 'react'; +import Debounce from 'lodash-decorators/debounce'; +import Bind from 'lodash-decorators/bind'; import { Table, Button, Input, message, Popconfirm, Divider } from 'antd'; import styles from './style.less'; @@ -33,6 +35,8 @@ export default class TableForm extends PureComponent { } }); } + @Bind() + @Debounce(400) toggleEditable(e, key) { e.preventDefault(); const newData = this.state.data.map(item => ({ ...item })); -- GitLab