2020-05-25 18:59:00 +08:00
|
|
|
---
|
|
|
|
order: 8
|
|
|
|
title:
|
|
|
|
zh-CN: 多彩文字提示
|
|
|
|
en-US: Colorful Tooltip
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
我们添加了多种预设色彩的文字提示样式,用作不同场景使用。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
We preset a series of colorful Tooltip styles for use in different situations.
|
|
|
|
|
|
|
|
```jsx
|
|
|
|
import { Tooltip, Button, Divider } from 'antd';
|
|
|
|
|
|
|
|
const colors = [
|
|
|
|
'pink',
|
|
|
|
'red',
|
|
|
|
'yellow',
|
|
|
|
'orange',
|
|
|
|
'cyan',
|
|
|
|
'green',
|
|
|
|
'blue',
|
|
|
|
'purple',
|
|
|
|
'geekblue',
|
|
|
|
'magenta',
|
|
|
|
'volcano',
|
|
|
|
'gold',
|
|
|
|
'lime',
|
|
|
|
];
|
|
|
|
const customColors = ['#f50', '#2db7f5', '#87d068', '#108ee9'];
|
|
|
|
|
2022-04-03 23:27:45 +08:00
|
|
|
export default () => (
|
2020-05-25 18:59:00 +08:00
|
|
|
<>
|
|
|
|
<Divider orientation="left">Presets</Divider>
|
|
|
|
<div>
|
|
|
|
{colors.map(color => (
|
|
|
|
<Tooltip title="prompt text" color={color} key={color}>
|
|
|
|
<Button>{color}</Button>
|
|
|
|
</Tooltip>
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
<Divider orientation="left">Custom</Divider>
|
|
|
|
<div>
|
|
|
|
{customColors.map(color => (
|
|
|
|
<Tooltip title="prompt text" color={color} key={color}>
|
|
|
|
<Button>{color}</Button>
|
|
|
|
</Tooltip>
|
|
|
|
))}
|
|
|
|
</div>
|
2022-04-03 23:27:45 +08:00
|
|
|
</>
|
2020-05-25 18:59:00 +08:00
|
|
|
);
|
|
|
|
```
|
|
|
|
|
|
|
|
```css
|
|
|
|
.ant-tag {
|
|
|
|
margin-bottom: 8px;
|
|
|
|
}
|
|
|
|
```
|