From 09c208831f88d11f4475d3cc30d7b2c879888866 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 10 Nov 2015 16:07:23 +0800 Subject: [PATCH] ref #498 --- components/popover/demo/control.md | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 components/popover/demo/control.md diff --git a/components/popover/demo/control.md b/components/popover/demo/control.md new file mode 100644 index 0000000000..a07591bee6 --- /dev/null +++ b/components/popover/demo/control.md @@ -0,0 +1,38 @@ +# 从浮层内关闭 + +- order: 3 + +使用 `visible` 属性控制浮层显示。 + +--- + +````jsx +import { Popover, Button } from 'antd'; + +const App = React.createClass({ + getInitialState() { + return { + visible: false + }; + }, + hide() { + this.setState({ + visible: false + }); + }, + handleVisibleChange(visible) { + this.setState({ visible }); + }, + render() { + const content =
+ 关闭卡片 +
; + return + + ; + } +}); + +ReactDOM.render(, document.getElementById('components-popover-demo-control')); +````