diff --git a/src/Step.jsx b/src/Step.jsx index 80dda12..4f5710a 100644 --- a/src/Step.jsx +++ b/src/Step.jsx @@ -30,6 +30,7 @@ export default class Step extends React.Component { PropTypes.bool, PropTypes.func, ]), + tailContent: PropTypes.any, }; renderIconNode() { const { @@ -68,7 +69,8 @@ export default class Step extends React.Component { className, prefixCls, style, itemWidth, status = 'wait', iconPrefix, icon, wrapperStyle, adjustMarginRight, stepNumber, - description, title, progressDot, ...restProps, + description, title, progressDot, tailContent, + ...restProps, } = this.props; const classString = classNames( @@ -90,7 +92,9 @@ export default class Step extends React.Component { className={classString} style={stepItemStyle} > -
+
+ {tailContent} +
{this.renderIconNode()}
diff --git a/tests/__snapshots__/index.test.js.snap b/tests/__snapshots__/index.test.js.snap index 117dfa1..9ba3497 100644 --- a/tests/__snapshots__/index.test.js.snap +++ b/tests/__snapshots__/index.test.js.snap @@ -984,6 +984,143 @@ exports[`Steps render renders step with description and status 1`] = `
`; +exports[`Steps render renders step with tailContent 1`] = ` +
+
+
+ text +
+
+ + 1 + +
+
+
+ 已完成 +
+
+ xx +
+
+
+
+
+
+ content +
+
+
+ + 2 + +
+
+
+ 进行中 +
+
+ xx +
+
+
+
+
+ 3 +
+
+ + 3 + +
+
+
+ 待运行 +
+
+ xx +
+
+
+
+
+ text +
+
+ + 4 + +
+
+
+ 待运行 +
+
+ xx +
+
+
+
+`; + exports[`Steps render renders vertical correctly 1`] = `
{ ); expect(wrapper).toMatchSnapshot(); }); + + it('renders step with tailContent', () => { + const wrapper = render( + + + content
} /> + + + + ); + expect(wrapper).toMatchSnapshot(); + }); }); });