From a277669aba00e8cee9cf8b815dd51658da3852a0 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 27 Dec 2015 13:34:59 +0800 Subject: [PATCH] Add comment for menu openKeys --- components/menu/demo/sider-current.md | 2 +- components/menu/index.jsx | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/components/menu/demo/sider-current.md b/components/menu/demo/sider-current.md index be120f1712..e87b22517e 100644 --- a/components/menu/demo/sider-current.md +++ b/components/menu/demo/sider-current.md @@ -24,7 +24,7 @@ const Sider = React.createClass({ openKeys: e.keyPath.slice(1) }); }, - onToggle(info){ + onToggle(info) { this.setState({ openKeys: info.open ? info.keyPath : info.keyPath.slice(1) }); diff --git a/components/menu/index.jsx b/components/menu/index.jsx index cc55e342cb..15c2208f5c 100644 --- a/components/menu/index.jsx +++ b/components/menu/index.jsx @@ -31,13 +31,13 @@ const AntMenu = React.createClass({ this.setState({ openKeys: e.openKeys }); - this.props.onOpen(); + this.props.onOpen(e); }, handleCloseKeys(e) { this.setState({ openKeys: e.openKeys }); - this.props.onClose(); + this.props.onClose(e); }, render() { let openAnimation = ''; @@ -54,6 +54,9 @@ const AntMenu = React.createClass({ default: } + // 这组属性的目的是 + // 弹出型的菜单需要点击后立即关闭 + // 另外,弹出型的菜单的受控模式没有使用场景 let props = { openKeys: this.state.openKeys, onClick: this.handleClick,