html技巧
通过将div设置成fixed,可以模拟弹窗。
<html>
<head>
<script>
.dialog-backdrop {
background: rgba(0, 0, 0, 0.2);
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
</script>
</head>
<body>
<div className="dialog-backdrop">
<div className="dialog-container">
<div className="dialog-header">提示</div>
<div className="dialog-body">{message}</div>
<div className="dialog-footer">
<button className="btn" onClick={close}>确定</button>
</div>
</div>
</div>
</body>
</html>