mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +08:00
use antd select
This commit is contained in:
parent
556ec6068c
commit
4cddeeea56
@ -52,6 +52,8 @@ InstantClickChangeFns.push(function () {
|
||||
});
|
||||
|
||||
InstantClickChangeFns.push(function () {
|
||||
var Select = antd.Select;
|
||||
var Option = Select.Option;
|
||||
var versionsHistory = {
|
||||
'0.9.2': '09x.ant.design'
|
||||
};
|
||||
@ -62,17 +64,19 @@ InstantClickChangeFns.push(function () {
|
||||
});
|
||||
var options = versions.map(function (version) {
|
||||
var link = versionsHistory[version];
|
||||
return <option key={version} value={version}>{version}</option>;
|
||||
return <Option key={version} value={version}>{version}</Option>;
|
||||
});
|
||||
|
||||
function onChange(e) {
|
||||
if (versionsHistory[e.target.value]) {
|
||||
location.href = location.href.replace(location.host, versionsHistory[e.target.value]);
|
||||
function onChange(value) {
|
||||
if (versionsHistory[value]) {
|
||||
location.href = location.href.replace(location.host, versionsHistory[value]);
|
||||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(<select defaultValue={antdVersion.latest}
|
||||
onChange={onChange}>{options}</select>, document.getElementById('versions-select'));
|
||||
ReactDOM.render(
|
||||
<Select defaultValue={antdVersion.latest} size="small" style={{width:130}}
|
||||
onChange={onChange}>{options}</Select>
|
||||
, document.getElementById('versions-select'));
|
||||
});
|
||||
|
||||
module.exports = antd;
|
||||
|
@ -1996,3 +1996,8 @@ a.entry-link:hover .anticon-smile {
|
||||
#instantclick-bar {
|
||||
background: #6EB4E0;
|
||||
}
|
||||
|
||||
#versions-select {
|
||||
position: relative;
|
||||
top: -2px;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user