--- order: 1 title: zh-CN: 带输入框的滑块 en-US: Slider with InputNumber --- ## zh-CN 和 [数字输入框](/components/input-number/) 组件保持同步。 ## en-US Synchronize with [InputNumber](/components/input-number/) component. ```jsx import { Slider, InputNumber, Row, Col } from 'antd'; class IntegerStep extends React.Component { state = { inputValue: 1, }; onChange = value => { this.setState({ inputValue: value, }); }; render() { const { inputValue } = this.state; return ( ); } } class DecimalStep extends React.Component { state = { inputValue: 0, }; onChange = value => { if (Number.isNaN(value)) { return; } this.setState({ inputValue: value, }); }; render() { const { inputValue } = this.state; return ( ); } } ReactDOM.render(
, mountNode, ); ```