You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
630 B

8 years ago
---
order: 6
iframe: 250
8 years ago
title:
zh-CN: 顶部公告
en-US: Banner
---
## zh-CN
页面顶部通告形式,默认有图标且 `type` 为 'warning'。
8 years ago
## en-US
Display Alert as a banner at top of page.
8 years ago
```tsx
8 years ago
import { Alert } from 'antd';
ReactDOM.render(
<>
8 years ago
<Alert message="Warning text" banner />
<br />
<Alert
message="Very long warning text warning text text text text text text text"
banner
closable
/>
<br />
<Alert showIcon={false} message="Warning text without icon" banner />
<br />
<Alert type="error" message="Error text" banner />
</>,
mountNode,
);
```