|
@ -34,7 +34,7 @@ export default class Header extends React.Component { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
handleMenuIconClick(e) { |
|
|
handleMenuIconClick = (e) => { |
|
|
e.stopPropagation(); |
|
|
e.stopPropagation(); |
|
|
e.nativeEvent.stopImmediatePropagation(); |
|
|
e.nativeEvent.stopImmediatePropagation(); |
|
|
this.setState({ |
|
|
this.setState({ |
|
@ -42,11 +42,11 @@ export default class Header extends React.Component { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
handleSearch(value) { |
|
|
handleSearch = (value) => { |
|
|
this.context.router.push({ pathname: value }); |
|
|
this.context.router.push({ pathname: value }); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
handleSelectFilter(value, option) { |
|
|
handleSelectFilter = (value, option) => { |
|
|
return option.props['data-label'].indexOf(value.toLowerCase()) > -1; |
|
|
return option.props['data-label'].indexOf(value.toLowerCase()) > -1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -79,7 +79,7 @@ export default class Header extends React.Component { |
|
|
<Col lg={4} md={6} sm={7} xs={24}> |
|
|
<Col lg={4} md={6} sm={7} xs={24}> |
|
|
<Icon |
|
|
<Icon |
|
|
className="nav-phone-icon" |
|
|
className="nav-phone-icon" |
|
|
onClick={this.handleMenuIconClick.bind(this)} |
|
|
onClick={this.handleMenuIconClick} |
|
|
type="menu" /> |
|
|
type="menu" /> |
|
|
<Link to="/" id="logo"> |
|
|
<Link to="/" id="logo"> |
|
|
<img src="https://t.alipayobjects.com/images/rmsweb/T1B9hfXcdvXXXXXXXX.svg" /> |
|
|
<img src="https://t.alipayobjects.com/images/rmsweb/T1B9hfXcdvXXXXXXXX.svg" /> |
|
@ -94,8 +94,8 @@ export default class Header extends React.Component { |
|
|
searchPlaceholder="搜索组件..." |
|
|
searchPlaceholder="搜索组件..." |
|
|
optionLabelProp="nothing" |
|
|
optionLabelProp="nothing" |
|
|
optionFilterProp="data-label" |
|
|
optionFilterProp="data-label" |
|
|
filterOption={this.handleSelectFilter.bind(this)} |
|
|
filterOption={this.handleSelectFilter} |
|
|
onSelect={this.handleSearch.bind(this)}> |
|
|
onSelect={this.handleSearch}> |
|
|
{options} |
|
|
{options} |
|
|
</Select> |
|
|
</Select> |
|
|
</div> |
|
|
</div> |
|
|