ant-design/components/modal/demo/info.md

62 lines
1.1 KiB
Markdown
Raw Normal View History

2016-03-31 09:40:55 +08:00
---
order: 5
2016-09-01 18:12:12 +08:00
title:
2016-08-11 11:41:06 +08:00
zh-CN: 信息提示
2016-09-01 18:12:12 +08:00
en-US: Information modal dialog
2016-03-31 09:40:55 +08:00
---
2015-09-07 11:48:57 +08:00
2016-08-11 11:41:06 +08:00
## zh-CN
2015-09-08 15:03:02 +08:00
各种类型的信息提示,只提供一个按钮用于关闭。
2015-09-07 11:48:57 +08:00
2016-08-11 11:41:06 +08:00
## en-US
2016-09-01 18:12:12 +08:00
In the various types of information modal dialog, only one button to close dialog is provided.
2016-08-11 11:41:06 +08:00
2019-05-07 14:57:32 +08:00
```jsx
import { Modal, Button, Space } from 'antd';
2015-09-07 11:48:57 +08:00
function info() {
Modal.info({
2016-08-11 11:41:06 +08:00
title: 'This is a notification message',
2016-03-18 11:48:06 +08:00
content: (
<div>
2016-08-11 11:41:06 +08:00
<p>some messages...some messages...</p>
<p>some messages...some messages...</p>
2016-03-18 11:48:06 +08:00
</div>
),
onOk() {},
2015-09-07 11:48:57 +08:00
});
}
function success() {
Modal.success({
2016-08-11 11:41:06 +08:00
content: 'some messages...some messages...',
2015-09-07 11:48:57 +08:00
});
}
function error() {
Modal.error({
2016-08-11 11:41:06 +08:00
title: 'This is an error message',
content: 'some messages...some messages...',
2015-09-07 11:48:57 +08:00
});
}
2016-04-11 14:59:37 +08:00
function warning() {
Modal.warning({
2016-09-01 18:12:12 +08:00
title: 'This is a warning message',
2016-08-11 11:41:06 +08:00
content: 'some messages...some messages...',
2016-04-11 14:59:37 +08:00
});
}
ReactDOM.render(
2021-09-13 19:27:31 +08:00
<Space wrap>
<Button onClick={info}>Info</Button>
<Button onClick={success}>Success</Button>
<Button onClick={error}>Error</Button>
<Button onClick={warning}>Warning</Button>
</Space>,
2019-05-07 14:57:32 +08:00
mountNode,
);
2019-05-07 14:57:32 +08:00
```