diff --git a/components/menu/demo/sider-current.md b/components/menu/demo/sider-current.md new file mode 100644 index 0000000000..4ad28142bb --- /dev/null +++ b/components/menu/demo/sider-current.md @@ -0,0 +1,64 @@ +# 只展开当前父级菜单 + +- order: 2 + +点击菜单,收起其他展开的所有菜单,保持菜单聚焦简洁。 + +--- + +````jsx +var Menu = antd.Menu; +var SubMenu = Menu.SubMenu; + +var Sider = React.createClass({ + getInitialState() { + return { + current: '1', + openKeys: [] + } + }, + handleClick(e) { + console.log('click ', e); + this.setState({ + current: e.key, + openKeys: e.keyPath.slice(1) + }); + }, + onToggle(info){ + this.setState({ + openKeys: info.openKeys + }); + }, + render() { + return + 导航一}> + 选项1 + 选项2 + 选项3 + 选项4 + + 导航二}> + 选项5 + 选项6 + + 选项7 + 选项8 + + + 导航三}> + 选项9 + 选项10 + 选项11 + 选项12 + + ; + } +}); +React.render(, document.getElementById('components-menu-demo-sider-current')); +```` diff --git a/components/menu/demo/vertical.md b/components/menu/demo/vertical.md index faab265c83..c0f4d15190 100644 --- a/components/menu/demo/vertical.md +++ b/components/menu/demo/vertical.md @@ -1,6 +1,6 @@ # 垂直菜单 -- order: 2 +- order: 3 子菜单是弹出的形式。