mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-28 19:18:40 +08:00
20 lines
321 B
Markdown
20 lines
321 B
Markdown
|
# 小数
|
|||
|
|
|||
|
- order: 3
|
|||
|
|
|||
|
和原生的数字输入框一样,value 的精度由 step 的小数位数决定。
|
|||
|
|
|||
|
---
|
|||
|
|
|||
|
````jsx
|
|||
|
import { InputNumber } from 'antd';
|
|||
|
|
|||
|
function onChange(value) {
|
|||
|
console.log('changed', value);
|
|||
|
}
|
|||
|
|
|||
|
ReactDOM.render(
|
|||
|
<InputNumber min={1} max={10} step={0.1} onChange={onChange} />
|
|||
|
, mountNode);
|
|||
|
````
|