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

37 lines
644 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';
2022-05-21 22:14:15 +08:00
import React from 'react';
2015-07-27 20:53:08 +08:00
const App: React.FC = () => (
<>
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" />
</>
2018-11-28 15:00:03 +08:00
);
export default App;
2019-05-07 14:57:32 +08:00
```
<style>
[data-theme="compact"] .code-box-demo .ant-alert {
margin-bottom: 8px;
}
</style>