2020-01-03 15:22:16 +08:00
|
|
|
---
|
|
|
|
order: 9
|
|
|
|
title:
|
|
|
|
zh-CN: 危险按钮
|
|
|
|
en-US: Danger Buttons
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
在 4.0 之后,危险成为一种按钮属性而不是按钮类型。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
`danger` is a property of button after antd 4.0.
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
|
|
|
import React from 'react';
|
2020-01-03 15:22:16 +08:00
|
|
|
import { Button } from 'antd';
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => (
|
2020-01-03 15:22:16 +08:00
|
|
|
<>
|
|
|
|
<Button type="primary" danger>
|
|
|
|
Primary
|
|
|
|
</Button>
|
|
|
|
<Button danger>Default</Button>
|
|
|
|
<Button type="dashed" danger>
|
2020-05-26 09:37:26 +08:00
|
|
|
Dashed
|
2020-01-03 15:22:16 +08:00
|
|
|
</Button>
|
2020-06-01 13:33:29 +08:00
|
|
|
<Button type="text" danger>
|
|
|
|
Text
|
|
|
|
</Button>
|
2020-01-03 15:22:16 +08:00
|
|
|
<Button type="link" danger>
|
2020-06-01 13:33:29 +08:00
|
|
|
Link
|
2020-01-03 15:22:16 +08:00
|
|
|
</Button>
|
2022-04-03 23:27:45 +08:00
|
|
|
</>
|
2020-01-03 15:22:16 +08:00
|
|
|
);
|
2022-05-19 09:46:26 +08:00
|
|
|
|
|
|
|
export default App;
|
2020-01-03 15:22:16 +08:00
|
|
|
```
|