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

60 lines
1.2 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
2017-02-13 10:55:53 +08:00
````jsx
import { Modal, Button } 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
title: 'This is a success message',
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
});
}
2015-10-20 16:47:55 +08:00
ReactDOM.render(<div>
2016-08-11 11:41:06 +08:00
<Button onClick={info}>Info</Button>
<Button onClick={success}>Success</Button>
<Button onClick={error}>Error</Button>
<Button onClick={warning}>Warning</Button>
</div>, mountNode);
2015-09-07 11:48:57 +08:00
````