import Button from '../../button'; import Dialog from '..'; import React from 'react'; import ReactDOM from 'react-dom'; import Switch from '../../switch'; const largeContent = new Array(60) .map((_, index) => (

Start your business here by searching a popular product

)); class Demo extends React.Component { state = { visible: false, isFullScreen: false, closeOnMaskClick: false, }; onOpen = () => { this.setState({ visible: true, }); }; onClose = () => { this.setState({ visible: false, }); }; toggleIsFullScreen = () => { this.setState({ isFullScreen: !this.state.isFullScreen, }); }; toggleCloseOnMaskClick = () => { this.setState({ closeOnMaskClick: !this.state.closeOnMaskClick, }); }; render() { const { visible, isFullScreen, closeOnMaskClick } = this.state; return (
When the height of the dialog exceeds the viewport height of the browser, whether to show the scroll bar:
Close on mask click:
{largeContent}
); } } ReactDOM.render(, document.getElementById('dialog-demo-6'));