mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
demo: update table demo code style
This commit is contained in:
parent
75a4b06e44
commit
a07c71165a
@ -91,7 +91,7 @@ class EditableTable extends React.Component {
|
||||
return (
|
||||
this.state.dataSource.length > 1 ?
|
||||
(
|
||||
<Popconfirm title="Sure to delete?" onConfirm={this.onDelete(index)}>
|
||||
<Popconfirm title="Sure to delete?" onConfirm={() => this.onDelete(index)}>
|
||||
<a href="#">Delete</a>
|
||||
</Popconfirm>
|
||||
) : null
|
||||
@ -122,11 +122,9 @@ class EditableTable extends React.Component {
|
||||
};
|
||||
}
|
||||
onDelete = (index) => {
|
||||
return () => {
|
||||
const dataSource = [...this.state.dataSource];
|
||||
dataSource.splice(index, 1);
|
||||
this.setState({ dataSource });
|
||||
};
|
||||
const dataSource = [...this.state.dataSource];
|
||||
dataSource.splice(index, 1);
|
||||
this.setState({ dataSource });
|
||||
}
|
||||
handleAdd = () => {
|
||||
const { count, dataSource } = this.state;
|
||||
|
Loading…
Reference in New Issue
Block a user