improve code style

This commit is contained in:
afc163 2016-06-20 16:25:35 +08:00
parent 36aa621fa4
commit f5c60541f3
2 changed files with 11 additions and 5 deletions

View File

@ -566,7 +566,9 @@ export default class Table extends React.Component {
if (column.filters && column.filters.length > 0) { if (column.filters && column.filters.length > 0) {
let colFilters = this.state.filters[key] || []; let colFilters = this.state.filters[key] || [];
filterDropdown = ( filterDropdown = (
<FilterDropdown locale={locale} column={column} <FilterDropdown
locale={locale}
column={column}
selectedKeys={colFilters} selectedKeys={colFilters}
confirmFilter={this.handleFilter} confirmFilter={this.handleFilter}
/> />

View File

@ -108,7 +108,8 @@ export default class FilterMenu extends React.Component {
const menus = ( const menus = (
<div className="ant-table-filter-dropdown"> <div className="ant-table-filter-dropdown">
<Menu multiple={multiple} <Menu
multiple={multiple}
onClick={this.handleMenuItemClick} onClick={this.handleMenuItemClick}
prefixCls="ant-dropdown-menu" prefixCls="ant-dropdown-menu"
onSelect={this.setSelectedKeys} onSelect={this.setSelectedKeys}
@ -118,12 +119,14 @@ export default class FilterMenu extends React.Component {
{this.renderMenus(column.filters)} {this.renderMenus(column.filters)}
</Menu> </Menu>
<div className="ant-table-filter-dropdown-btns"> <div className="ant-table-filter-dropdown-btns">
<a className="ant-table-filter-dropdown-link confirm" <a
className="ant-table-filter-dropdown-link confirm"
onClick={this.handleConfirm} onClick={this.handleConfirm}
> >
{locale.filterConfirm} {locale.filterConfirm}
</a> </a>
<a className="ant-table-filter-dropdown-link clear" <a
className="ant-table-filter-dropdown-link clear"
onClick={this.handleClearFilters} onClick={this.handleClearFilters}
> >
{locale.filterReset} {locale.filterReset}
@ -136,7 +139,8 @@ export default class FilterMenu extends React.Component {
? 'ant-table-filter-selected' : ''; ? 'ant-table-filter-selected' : '';
return ( return (
<Dropdown trigger={['click']} <Dropdown
trigger={['click']}
overlay={menus} overlay={menus}
visible={this.state.visible} visible={this.state.visible}
onVisibleChange={this.onVisibleChange} onVisibleChange={this.onVisibleChange}