2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 1
|
2016-07-04 10:49:26 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 四种样式
|
|
|
|
en-US: More types
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2015-07-27 20:53:08 +08:00
|
|
|
|
2016-07-04 10:49:26 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2016-03-28 14:38:25 +08:00
|
|
|
共有四种样式 `success`、`info`、`warning`、`error`。
|
2015-07-27 20:53:08 +08:00
|
|
|
|
2016-07-04 10:49:26 +08:00
|
|
|
## en-US
|
|
|
|
|
2016-09-14 09:52:14 +08:00
|
|
|
There are 4 types of Alert: `success`, `info`, `warning`, `error`.
|
2016-07-04 10:49:26 +08:00
|
|
|
|
2020-01-21 16:21:37 +08:00
|
|
|
```tsx
|
2015-10-28 20:55:49 +08:00
|
|
|
import { Alert } from 'antd';
|
2015-07-27 20:53:08 +08:00
|
|
|
|
2022-04-03 23:27:45 +08:00
|
|
|
export default () => (
|
2020-05-09 19:32:02 +08:00
|
|
|
<>
|
2017-10-09 13:23:20 +08:00
|
|
|
<Alert message="Success Text" type="success" />
|
|
|
|
<Alert message="Info Text" type="info" />
|
|
|
|
<Alert message="Warning Text" type="warning" />
|
|
|
|
<Alert message="Error Text" type="error" />
|
2022-04-03 23:27:45 +08:00
|
|
|
</>
|
2018-11-28 15:00:03 +08:00
|
|
|
);
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|
2020-04-28 11:16:01 +08:00
|
|
|
|
|
|
|
<style>
|
|
|
|
[data-theme="compact"] .code-box-demo .ant-alert {
|
|
|
|
margin-bottom: 8px;
|
|
|
|
}
|
|
|
|
</style>
|