ant-design/components/steps/demo/nav.md

103 lines
2.2 KiB
Markdown
Raw Normal View History

---
order: 11
title:
zh-CN: 导航步骤
2019-08-20 04:29:03 +08:00
en-US: Navigation Steps
---
## zh-CN
导航类型的步骤条。
## en-US
2019-08-20 04:29:03 +08:00
Navigation steps.
```tsx
import { Steps } from 'antd';
2022-05-21 22:14:15 +08:00
import React, { useState } from 'react';
const { Step } = Steps;
const App: React.FC = () => {
const [current, setCurrent] = useState(0);
const onChange = (value: number) => {
console.log('onChange:', value);
setCurrent(value);
};
return (
<>
<Steps
type="navigation"
size="small"
current={current}
onChange={onChange}
className="site-navigation-steps"
>
<Step
title="Step 1"
subTitle="00:00:05"
status="finish"
description="This is a description."
/>
<Step
title="Step 2"
subTitle="00:01:02"
status="process"
description="This is a description."
/>
<Step
title="Step 3"
subTitle="waiting for longlong time"
status="wait"
description="This is a description."
/>
</Steps>
<Steps
type="navigation"
current={current}
onChange={onChange}
className="site-navigation-steps"
>
<Step status="finish" title="Step 1" />
<Step status="process" title="Step 2" />
<Step status="wait" title="Step 3" />
<Step status="wait" title="Step 4" />
</Steps>
<Steps
type="navigation"
size="small"
current={current}
onChange={onChange}
className="site-navigation-steps"
>
<Step status="finish" title="finish 1" />
<Step status="finish" title="finish 2" />
<Step status="process" title="current process" />
<Step status="wait" title="wait" disabled />
</Steps>
</>
);
};
export default App;
```
2019-12-23 20:07:56 +08:00
```css
[data-theme='compact'] .site-navigation-steps.ant-steps.ant-steps-navigation,
.site-navigation-steps.ant-steps.ant-steps-navigation {
2019-12-23 20:07:56 +08:00
margin-bottom: 60px;
box-shadow: 0px -1px 0 0 #e8e8e8 inset;
}
```
2019-12-25 22:13:04 +08:00
<style>
[data-theme="dark"] .site-navigation-steps.ant-steps.ant-steps-navigation {
2019-12-25 22:13:04 +08:00
border-bottom: 1px solid #303030;
margin-bottom: 60px;
box-shadow: none;
}
</style>