ant-design/components/alert/demo/style.md

35 lines
603 B
Markdown
Raw Normal View History

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