mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 05:05:48 +08:00
Add document version switch in footer, #406
This commit is contained in:
parent
a2b07e2a3b
commit
f26bbc1cd5
@ -39,7 +39,7 @@ React.render(
|
||||
````
|
||||
|
||||
````css
|
||||
.ant-select{
|
||||
.code-box-demo .ant-select {
|
||||
margin: 0 10px 10px 0;
|
||||
}
|
||||
````
|
||||
|
@ -48,4 +48,24 @@ InstantClickChangeFns.push(function () {
|
||||
React.render(<AutoComplete/>, document.getElementById('autoComplete'));
|
||||
});
|
||||
|
||||
InstantClickChangeFns.push(function () {
|
||||
var versionsHistory = {
|
||||
'0.9.1': 'http://09x.ant.design'
|
||||
};
|
||||
versionsHistory[antdVersion.latest] =
|
||||
versionsHistory[antdVersion.latest] || 'http://ant.design';
|
||||
var options = Object.keys(versionsHistory).map(function(version) {
|
||||
var link = versionsHistory[version];
|
||||
return <option value={version}>{version}</option>;
|
||||
});
|
||||
function onChange(e) {
|
||||
if (versionsHistory[e.target.value]) {
|
||||
location.replace(versionsHistory[e.target.value]);
|
||||
}
|
||||
}
|
||||
React.render(<select defaultValue={antdVersion.latest} onChange={onChange}>
|
||||
{options}
|
||||
</select>, document.getElementById('versions-select'))
|
||||
});
|
||||
|
||||
module.exports = antd;
|
||||
|
@ -16,6 +16,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<h3>©2015 蚂蚁金服体验技术部出品</h3>
|
||||
<h3>文档版本:<span id="versions-select"></span></h3>
|
||||
</li>
|
||||
</ul>
|
||||
</footer>
|
||||
|
Loading…
Reference in New Issue
Block a user