mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-12 07:09:55 +08:00
6776bb8916
* docs: update demo * chore: add script * test: fix demo test * docs: convert demos * chore: move script * test: remove react-dom import * chore: update deps * docs: update riddle js * test: fix image test * docs: fix riddle demo
36 lines
622 B
Markdown
36 lines
622 B
Markdown
---
|
|
order: 6
|
|
iframe: 250
|
|
title:
|
|
zh-CN: 顶部公告
|
|
en-US: Banner
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
页面顶部通告形式,默认有图标且 `type` 为 'warning'。
|
|
|
|
## en-US
|
|
|
|
Display Alert as a banner at top of page.
|
|
|
|
```tsx
|
|
import { Alert } from 'antd';
|
|
|
|
export default () => (
|
|
<>
|
|
<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 />
|
|
</>
|
|
);
|
|
```
|