ant-design/components/modal/demo/info.md
MadCcc 6776bb8916
docs: demo support react18 (#34843)
* docs: update demo

* chore: add script

* test: fix demo test

* docs: convert demos

* chore: move script

* test: remove react-dom import

* chore: update deps

* docs: update riddle js

* test: fix image test

* docs: fix riddle demo
2022-04-03 23:27:45 +08:00

61 lines
1.1 KiB
Markdown

---
order: 5
title:
zh-CN: 信息提示
en-US: Information modal dialog
---
## zh-CN
各种类型的信息提示,只提供一个按钮用于关闭。
## en-US
In the various types of information modal dialog, only one button to close dialog is provided.
```jsx
import { Modal, Button, Space } 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...',
});
}
export default () => (
<Space wrap>
<Button onClick={info}>Info</Button>
<Button onClick={success}>Success</Button>
<Button onClick={error}>Error</Button>
<Button onClick={warning}>Warning</Button>
</Space>
);
```