Browse Source

feat: Steps.Step[icon] support React.ReactNode, close: #3159

pull/3223/head
Benjy Cui 8 years ago
parent
commit
1e65cac784
  1. 7
      components/steps/demo/error.md
  2. 8
      components/steps/demo/icon.md
  3. 7
      components/steps/demo/simple.md
  4. 7
      components/steps/demo/small-size.md
  5. 6
      components/steps/demo/step-next.md
  6. 7
      components/steps/demo/vertical-small.md
  7. 7
      components/steps/demo/vertical.md
  8. 6
      components/steps/index.en-US.md
  9. 6
      components/steps/index.zh-CN.md
  10. 2
      package.json

7
components/steps/demo/error.md

@ -19,10 +19,9 @@ const Step = Steps.Step;
ReactDOM.render(
<Steps current={1} status="error">
<Step title="已完成" description="这里是多信息的描述" />
<Step title="进行中" description="这里是多信息的描述" />
<Step title="待运行" description="这里是多信息的描述" />
<Step title="待运行" description="这里是多信息的描述" />
<Step title="finished" description="This is description" />
<Step title="In Process" description="This is description" />
<Step title="Waiting" description="This is description" />
</Steps>
, mountNode);
````

8
components/steps/demo/icon.md

@ -14,14 +14,14 @@ title:
You can use your own custom icons by setting the property `icon` for `Steps.Step`.
````jsx
import { Steps } from 'antd';
import { Steps, Icon } from 'antd';
const Step = Steps.Step;
ReactDOM.render(
<Steps>
<Step status="finish" title="步骤1" icon="cloud" />
<Step status="process" title="步骤2" icon="apple" />
<Step status="wait" title="步骤3" icon="github" />
<Step status="finish" title="Step 1" icon="cloud" />
<Step status="process" title="Step 2" icon="apple" />
<Step status="wait" title="Step 3" icon={<Icon type="github" />} />
</Steps>
, mountNode);
````

7
components/steps/demo/simple.md

@ -19,10 +19,9 @@ const Step = Steps.Step;
ReactDOM.render(
<Steps current={1}>
<Step title="已完成" description="这里是多信息的描述" />
<Step title="进行中" description="这里是多信息的描述" />
<Step title="待运行" description="这里是多信息的描述" />
<Step title="待运行" description="这里是多信息的描述" />
<Step title="Finished" description="This is description." />
<Step title="In Progress" description="This is description." />
<Step title="Waiting" description="This is description." />
</Steps>
, mountNode);
````

7
components/steps/demo/small-size.md

@ -19,10 +19,9 @@ const Step = Steps.Step;
ReactDOM.render(
<Steps size="small" current={1}>
<Step title="已完成" />
<Step title="进行中" />
<Step title="待运行" />
<Step title="待运行" />
<Step title="Finished" />
<Step title="In Progress" />
<Step title="Waiting" />
</Steps>
, mountNode);
````

6
components/steps/demo/step-next.md

@ -18,7 +18,7 @@ import { Steps, Button } from 'antd';
const Step = Steps.Step;
const array = [...Array(Math.floor(Math.random() * 3) + 3)];
const steps = array.map((item, i) => ({
title: `步骤${i + 1}`,
title: `Step ${i + 1}`,
}));
const App = React.createClass({
@ -38,12 +38,12 @@ const App = React.createClass({
const { current } = this.state;
return (
<div>
<div style={{ marginBottom: 24 }}>当前正在执行第 {current + 1} 步</div>
<div style={{ marginBottom: 24 }}>Curent Step {current + 1}</div>
<Steps current={current}>
{steps.map((s, i) => <Step key={i} title={s.title} description={s.description} />)}
</Steps>
<div style={{ marginTop: 24 }}>
<Button onClick={this.next}>下一步</Button>
<Button onClick={this.next}>Next Step</Button>
</div>
</div>
);

7
components/steps/demo/vertical-small.md

@ -19,10 +19,9 @@ const Step = Steps.Step;
ReactDOM.render(
<Steps direction="vertical" size="small" current={1}>
<Step title="已完成" description="这里是多信息的描述" />
<Step title="进行中" description="这里是多信息的描述" />
<Step title="待运行" description="这里是多信息的描述" />
<Step title="待运行" description="这里是多信息的描述" />
<Step title="Finished" description="This is description." />
<Step title="In Progress" description="This is description." />
<Step title="Waiting" description="This is description." />
</Steps>
, mountNode);
````

7
components/steps/demo/vertical.md

@ -19,10 +19,9 @@ const Step = Steps.Step;
ReactDOM.render(
<Steps direction="vertical" current={1}>
<Step title="已完成" description="这里是多信息的描述" />
<Step title="进行中" description="这里是多信息的描述" />
<Step title="待运行" description="这里是多信息的描述" />
<Step title="待运行" description="这里是多信息的描述" />
<Step title="Finished" description="This is description." />
<Step title="In Progress" description="This is description." />
<Step title="Waiting" description="This is description." />
</Steps>
, mountNode);
````

6
components/steps/index.en-US.md

@ -39,6 +39,6 @@ A single step in the step bar.
Property | Description | Type | Default
-----|-----|-----|------
status | to specify the status. It will be automatically set by `current` of `Steps` if not configured. Optional values are: `wait` `process` `finish` `error` | String | wait
title | title of the step | React.Element | -
description | detail of the step, optional property | React.Element | -
icon | icon of the step, optional property | React.Element | -
title | title of the step | React.ReactNode | -
description | detail of the step, optional property | React.ReactNode | -
icon | icon of the step, optional property | string or React.ReactNode | -

6
components/steps/index.zh-CN.md

@ -40,6 +40,6 @@ title: Steps
| 参数 | 说明 | 类型 | 默认值 |
|----------|-----------------------------------------|------------|-------|
| status | 指定状态。当不配置该属性时,会使用 Steps 的 `current` 来自动指定状态。可选:`wait` `process` `finish` `error` | String | wait |
| title | 标题 | React.Element | - |
| description | 步骤的详情描述,可选 | React.Element | - |
| icon | 步骤图标的类型,可选 | string | - |
| title | 标题 | React.ReactNode | - |
| description | 步骤的详情描述,可选 | React.ReactNode | - |
| icon | 步骤图标的类型,可选 | string or React.ReactNode | - |

2
package.json

@ -60,7 +60,7 @@
"rc-rate": "~1.1.2",
"rc-select": "~6.5.1",
"rc-slider": "~5.1.0",
"rc-steps": "~2.1.5",
"rc-steps": "~2.2.0",
"rc-switch": "~1.4.2",
"rc-table": "~5.0.0",
"rc-tabs": "~7.0.5",

Loading…
Cancel
Save