💄 code style optimizaiton

This commit is contained in:
afc163 2019-07-24 15:40:07 +08:00
parent bc2d24646e
commit 22179f3511
2 changed files with 6 additions and 5 deletions

View File

@ -132,7 +132,7 @@ class App extends React.Component {
...this.getColumnSearchProps('address'),
},
];
return <Table columns={columns} dataSource={data} />;
return <Table columns={columns} dataSource={data} onChange={this.onChange} />;
}
}

View File

@ -138,12 +138,13 @@ class FilterMenu<T> extends React.Component<FilterMenuProps<T>, FilterMenuState<
};
confirmFilter() {
const { column, selectedKeys: propSelectedKeys, confirmFilter } = this.props;
const { selectedKeys, valueKeys } = this.state;
const { filterDropdown } = this.props.column;
const { filterDropdown } = column;
if (!shallowequal(selectedKeys, this.props.selectedKeys)) {
this.props.confirmFilter(
this.props.column,
if (!shallowequal(selectedKeys, propSelectedKeys)) {
confirmFilter(
column,
filterDropdown
? selectedKeys
: selectedKeys.map(key => valueKeys[key]).filter(key => key !== undefined),