diff --git a/components/dropdown/demo/overlay-visible.md b/components/dropdown/demo/overlay-visible.md new file mode 100644 index 0000000000..0c303c2a2d --- /dev/null +++ b/components/dropdown/demo/overlay-visible.md @@ -0,0 +1,46 @@ +--- +order: 6 +title: 菜单隐藏方式 +------------- + +默认是点击关闭菜单,可以关闭此功能。 + +````jsx +import { Menu, Dropdown, Icon } from 'antd'; + +const OverlayVisible = React.createClass({ + getInitialState() { + return { + visible: false + }; + }, + handleMenuClick(e) { + if (e.key === '3') { + this.setState({ visible: false }); + } + }, + handleVisibleChange(flag) { + this.setState({ visible: flag }); + }, + render() { + const menu = ( + + 点我不会关闭菜单 + 点我还是不会关闭菜单 + 点我才会关闭菜单 + + ); + return ( + + + 鼠标移入 + + + ); + } +}); + +ReactDOM.render(, mountNode); +```` diff --git a/components/dropdown/index.md b/components/dropdown/index.md index e6ec0e2b18..ebbcdfaa06 100644 --- a/components/dropdown/index.md +++ b/components/dropdown/index.md @@ -33,3 +33,5 @@ english: Dropdown | onClick | 点击左侧按钮的回调,和 [Button](/components/button) 一致 | Function | 无 | | trigger | 触发下拉的行为 | "click" or "hover" | hover | | overlay | 菜单节点 | [Menu](/components/menu) | 无 | +| visible | 菜单节点是否显示 | Bool | 无 | +| onVisibleChange | 菜单节点显示状态改变时调用,参数为 {visible} | Function | 无 |