2017-01-23 14:37:40 +08:00
|
|
|
---
|
|
|
|
order: 9
|
|
|
|
title:
|
|
|
|
zh-CN: 自定义点状步骤条
|
|
|
|
en-US: Customized Dot Style
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
为点状步骤条增加自定义展示。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
You can customize the display for Steps with progress dot style.
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
|
|
|
import type { StepsProps } from 'antd';
|
2022-05-23 14:37:16 +08:00
|
|
|
import { Popover, Steps } from 'antd';
|
|
|
|
import React from 'react';
|
2018-06-27 15:55:04 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const customDot: StepsProps['progressDot'] = (dot, { status, index }) => (
|
2019-05-07 14:57:32 +08:00
|
|
|
<Popover
|
|
|
|
content={
|
|
|
|
<span>
|
|
|
|
step {index} status: {status}
|
|
|
|
</span>
|
|
|
|
}
|
|
|
|
>
|
2017-01-23 16:09:34 +08:00
|
|
|
{dot}
|
|
|
|
</Popover>
|
|
|
|
);
|
2022-09-16 15:52:14 +08:00
|
|
|
const description = 'You can hover on the dot.';
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => (
|
2022-09-16 15:52:14 +08:00
|
|
|
<Steps
|
|
|
|
current={1}
|
|
|
|
progressDot={customDot}
|
|
|
|
items={[
|
|
|
|
{
|
|
|
|
title: 'Finished',
|
|
|
|
description,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'In Progress',
|
|
|
|
description,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Waiting',
|
|
|
|
description,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Waiting',
|
|
|
|
description,
|
|
|
|
},
|
|
|
|
]}
|
|
|
|
/>
|
2018-11-28 15:00:03 +08:00
|
|
|
);
|
2022-05-19 09:46:26 +08:00
|
|
|
|
|
|
|
export default App;
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|