site: support header jumper

This commit is contained in:
Benjy Cui 2016-03-10 16:01:39 +08:00
parent 63a549dbc9
commit f6a5c7ad2e

View File

@ -8,7 +8,7 @@ import './index.less';
import componentsList from '../../../_site/data/react-components'; import componentsList from '../../../_site/data/react-components';
export default class Header extends React.Component { export default class Header extends React.Component {
handleSearch(value) { handleSearch(value) {
console.log(value); this.props.history.push({ pathname: value });
} }
render() { render() {
@ -40,7 +40,9 @@ export default class Header extends React.Component {
</Col> </Col>
<Col span="20"> <Col span="20">
<div id="search-box"> <div id="search-box">
<Select combobox searchPlaceholder="搜索组件..." onChange={this.handleSearch.bind(this)}> <Select combobox
searchPlaceholder="搜索组件..." optionLabelProp="nothing"
onChange={this.handleSearch.bind(this)}>
{options} {options}
</Select> </Select>
</div> </div>