Browse Source

demo: update menu sider demo

pull/4745/merge
afc163 8 years ago
parent
commit
144393c48a
  1. 18
      components/menu/demo/sider.md
  2. 2
      components/style/core/motion.less

18
components/menu/demo/sider.md

@ -19,31 +19,24 @@ const SubMenu = Menu.SubMenu;
const MenuItemGroup = Menu.ItemGroup;
const Sider = React.createClass({
getInitialState() {
return {
current: '1',
};
},
handleClick(e) {
console.log('click ', e);
this.setState({
current: e.key,
});
},
render() {
return (
<Menu onClick={this.handleClick}
<Menu
onClick={this.handleClick}
style={{ width: 240 }}
defaultSelectedKeys={['1']}
defaultOpenKeys={['sub1']}
selectedKeys={[this.state.current]}
mode="inline"
>
<SubMenu key="sub1" title={<span><Icon type="mail" /><span>Navigation One</span></span>}>
<MenuItemGroup title="Item 1">
<MenuItemGroup key="g1" title="Item 1">
<Menu.Item key="1">Option 1</Menu.Item>
<Menu.Item key="2">Option 2</Menu.Item>
</MenuItemGroup>
<MenuItemGroup title="Item 2">
<MenuItemGroup key="g2" title="Item 2">
<Menu.Item key="3">Option 3</Menu.Item>
<Menu.Item key="4">Option 4</Menu.Item>
</MenuItemGroup>
@ -66,5 +59,6 @@ const Sider = React.createClass({
);
},
});
ReactDOM.render(<Sider />, mountNode);
````

2
components/style/core/motion.less

@ -10,6 +10,6 @@
.ant-motion-collapse {
overflow: hidden;
&-active {
transition: height .2s @ease-out;
transition: height .2s ease-out;
}
}

Loading…
Cancel
Save