UNPKG

cjd-parkball

Version:

> 中后台业务组件库,中后台就像公园,进入需要买门票(登录),所以以 Parkball(公园球) 命名,公园内必定捕获!作为一个组件库,提供使用方法文档,方便开发者的调用

50 lines (39 loc) 841 B
--- category: 2 title: 从浮层内关闭 title_en: Controlling the close of the dialog --- zh-CN 使用 `visible` 属性控制浮层显示。 en-US Use `visible` prop to control the display of the card. ````jsx import { Popover, Button } from 'parkball'; class App extends React.Component { state = { visible: false, } hide = () => { this.setState({ visible: false, }); } handleVisibleChange = (visible) => { this.setState({ visible }); } render() { return ( <Popover content={<a onClick={this.hide}>Close</a>} title="Title" trigger="click" visible={this.state.visible} onVisibleChange={this.handleVisibleChange} > <Button type="primary">Click me</Button> </Popover> ); } } ReactDOM.render(<App />, mountNode); ````