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
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
2022-05-21 22:14:15 +08:00
|
|
|
import { Button, Modal, Space } from 'antd';
|
2022-05-19 09:46:26 +08:00
|
|
|
import React from 'react';
|
2015-09-07 11:48:57 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const info = () => {
|
2015-09-07 11:48:57 +08:00
|
|
|
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
|
|
|
});
|
2022-05-19 09:46:26 +08:00
|
|
|
};
|
2015-09-07 11:48:57 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const success = () => {
|
2015-09-07 11:48:57 +08:00
|
|
|
Modal.success({
|
2016-08-11 11:41:06 +08:00
|
|
|
content: 'some messages...some messages...',
|
2015-09-07 11:48:57 +08:00
|
|
|
});
|
2022-05-19 09:46:26 +08:00
|
|
|
};
|
2015-09-07 11:48:57 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const error = () => {
|
2015-09-07 11:48:57 +08:00
|
|
|
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
|
|
|
});
|
2022-05-19 09:46:26 +08:00
|
|
|
};
|
2015-09-07 11:48:57 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const warning = () => {
|
2016-04-11 14:59:37 +08:00
|
|
|
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
|
|
|
});
|
2022-05-19 09:46:26 +08:00
|
|
|
};
|
2016-04-11 14:59:37 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => (
|
2021-09-13 19:27:31 +08:00
|
|
|
<Space wrap>
|
2017-05-16 10:43:12 +08:00
|
|
|
<Button onClick={info}>Info</Button>
|
|
|
|
<Button onClick={success}>Success</Button>
|
|
|
|
<Button onClick={error}>Error</Button>
|
|
|
|
<Button onClick={warning}>Warning</Button>
|
2022-04-03 23:27:45 +08:00
|
|
|
</Space>
|
2017-05-16 10:43:12 +08:00
|
|
|
);
|
2022-05-19 09:46:26 +08:00
|
|
|
|
|
|
|
export default App;
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|