import React from 'react'; import ReactDOM from 'react-dom'; import Step from '..'; import { Button } from '../..'; const StepItem = Step.Item, ButtonGroup = Button.Group; class Component extends React.Component { state = { currentStep: 3, }; next() { const s = this.state.currentStep + 1; this.setState({ currentStep: s > 6 ? 6 : s, }); } prev() { const s = this.state.currentStep - 1; this.setState({ currentStep: s < 0 ? 0 : s, }); } onClick(currentStep) { console.log(currentStep); this.setState({ currentStep, }); } render() { const { currentStep } = this.state; return (


); } } ReactDOM.render(, document.getElementById('step-demo-7'));