Browse Source

update select combobox demo

pull/26/head
afc163 10 years ago
parent
commit
5ac56461a1
  1. 38
      components/select/demo/combobox.md
  2. 2
      style/components/select.less

38
components/select/demo/combobox.md

@ -0,0 +1,38 @@
# suggest
- order: 4
类似 Google 搜索的输入框自动提示功能。
---
````jsx
var Select = antd.Select;
var Option = Select.Option;
var Test = React.createClass({
getInitialState() {
return {
options: []
};
},
handleChange(value) {
var options = ['gmail.com', '163.com', 'qq.com'].map(function(domain) {
var email = value + '@' + domain;
return <Option value={email}>{email}</Option>;
});
this.setState({
options: options
});
},
render() {
return <Select combobox style={{width:200}} onChange={this.handleChange}>
{this.state.options}
</Select>;
}
});
React.render(<Test />, document.getElementById('components-select-demo-combobox'));
````

2
style/components/select.less

@ -89,7 +89,7 @@
text-overflow: ellipsis;
padding-left: 10px;
padding-right: 20px;
line-height: 28px;
line-height: 26px;
}
.@{selectPrefixCls}-selection__clear {

Loading…
Cancel
Save