index.js 459 B

12345678910111213141516171819
  1. import React from 'react';
  2. import './index.less';
  3. function Step(props) {
  4. const { list = [], step = 1 } = props;
  5. return (
  6. <div className="step">
  7. {list.map((item, index) => {
  8. return (
  9. <div className={`item ${index === step - 1 ? 'active' : ''} ${step - 1 > index ? 'over' : ''}`}>
  10. <span className="text">{item}</span>
  11. </div>
  12. );
  13. })}
  14. </div>
  15. );
  16. }
  17. Step.propTypes = {};
  18. export default Step;