mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-16 01:41:02 +08:00
7691047882
* 🐛 fix Modal icon position close #19389 not render title when Modal title is undefined. * ✅ (Modal): add test for modal without title
1.1 KiB
1.1 KiB
order | title | ||||
---|---|---|---|---|---|
5 |
|
zh-CN
各种类型的信息提示,只提供一个按钮用于关闭。
en-US
In the various types of information modal dialog, only one button to close dialog is provided.
import { Modal, Button } from 'antd';
function info() {
Modal.info({
title: 'This is a notification message',
content: (
<div>
<p>some messages...some messages...</p>
<p>some messages...some messages...</p>
</div>
),
onOk() {},
});
}
function success() {
Modal.success({
content: 'some messages...some messages...',
});
}
function error() {
Modal.error({
title: 'This is an error message',
content: 'some messages...some messages...',
});
}
function warning() {
Modal.warning({
title: 'This is a warning message',
content: 'some messages...some messages...',
});
}
ReactDOM.render(
<div>
<Button onClick={info}>Info</Button>
<Button onClick={success}>Success</Button>
<Button onClick={error}>Error</Button>
<Button onClick={warning}>Warning</Button>
</div>,
mountNode,
);