@@ -21,13 +21,15 @@ export default class Steps extends Component {
2121 PropTypes . func ,
2222 ] ) ,
2323 style : PropTypes . object ,
24+ initial : PropTypes . number ,
2425 current : PropTypes . number ,
2526 } ;
2627 static defaultProps = {
2728 prefixCls : 'rc-steps' ,
2829 iconPrefix : 'rc' ,
2930 direction : 'horizontal' ,
3031 labelPlacement : 'horizontal' ,
32+ initial : 0 ,
3133 current : 0 ,
3234 status : 'process' ,
3335 size : '' ,
@@ -75,7 +77,7 @@ export default class Steps extends Component {
7577 const lastStepOffsetWidth = ( domNode . lastChild . offsetWidth || 0 ) + 1 ;
7678 // Reduce shake bug
7779 if ( this . state . lastStepOffsetWidth === lastStepOffsetWidth ||
78- Math . abs ( this . state . lastStepOffsetWidth - lastStepOffsetWidth ) <= 3 ) {
80+ Math . abs ( this . state . lastStepOffsetWidth - lastStepOffsetWidth ) <= 3 ) {
7981 return ;
8082 }
8183 this . setState ( { lastStepOffsetWidth } ) ;
@@ -85,7 +87,7 @@ export default class Steps extends Component {
8587 render ( ) {
8688 const {
8789 prefixCls, style = { } , className, children, direction,
88- labelPlacement, iconPrefix, status, size, current, progressDot,
90+ labelPlacement, iconPrefix, status, size, current, progressDot, initial ,
8991 ...restProps ,
9092 } = this . props ;
9193 const { lastStepOffsetWidth, flexSupported } = this . state ;
@@ -105,8 +107,9 @@ export default class Steps extends Component {
105107 if ( ! child ) {
106108 return null ;
107109 }
110+ const stepNumber = initial ? initial + index : index + 1 ;
108111 const childProps = {
109- stepNumber : ` ${ index + 1 } ` ,
112+ stepNumber,
110113 prefixCls,
111114 iconPrefix,
112115 wrapperStyle : style ,
@@ -122,9 +125,9 @@ export default class Steps extends Component {
122125 childProps . className = `${ prefixCls } -next-error` ;
123126 }
124127 if ( ! child . props . status ) {
125- if ( index === current ) {
128+ if ( stepNumber === current ) {
126129 childProps . status = status ;
127- } else if ( index < current ) {
130+ } else if ( stepNumber < current ) {
128131 childProps . status = 'finish' ;
129132 } else {
130133 childProps . status = 'wait' ;
0 commit comments